summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse
diff options
context:
space:
mode:
authorSerge Pavlov <sepavloff@gmail.com>2015-06-29 17:50:19 +0000
committerSerge Pavlov <sepavloff@gmail.com>2015-06-29 17:50:19 +0000
commit3739f5e7c9d33d0ceed7f849505a91efa01294c5 (patch)
tree8279b1818069e4aedc926690282f42c2cc6817b5 /clang/lib/Parse
parentae51f5bab147fffbb82756d4216a7ae2606118eb (diff)
downloadbcm5719-llvm-3739f5e7c9d33d0ceed7f849505a91efa01294c5.tar.gz
bcm5719-llvm-3739f5e7c9d33d0ceed7f849505a91efa01294c5.zip
Instantiation of local class members.
If a function containing a local class is instantiated, instantiate all of local class member, including default arguments and exception specifications. This change fixes PR21332 and thus implements DR1484. Differential Revision: http://reviews.llvm.org/D9990 llvm-svn: 240974
Diffstat (limited to 'clang/lib/Parse')
-rw-r--r--clang/lib/Parse/ParseDeclCXX.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp
index 47778b856dd..6531f7b902d 100644
--- a/clang/lib/Parse/ParseDeclCXX.cpp
+++ b/clang/lib/Parse/ParseDeclCXX.cpp
@@ -3317,13 +3317,16 @@ Parser::tryParseExceptionSpecification(bool Delayed,
T.consumeOpen();
NoexceptType = EST_ComputedNoexcept;
NoexceptExpr = ParseConstantExpression();
+ T.consumeClose();
// The argument must be contextually convertible to bool. We use
// ActOnBooleanCondition for this purpose.
- if (!NoexceptExpr.isInvalid())
+ if (!NoexceptExpr.isInvalid()) {
NoexceptExpr = Actions.ActOnBooleanCondition(getCurScope(), KeywordLoc,
NoexceptExpr.get());
- T.consumeClose();
- NoexceptRange = SourceRange(KeywordLoc, T.getCloseLocation());
+ NoexceptRange = SourceRange(KeywordLoc, T.getCloseLocation());
+ } else {
+ NoexceptType = EST_None;
+ }
} else {
// There is no argument.
NoexceptType = EST_BasicNoexcept;
OpenPOWER on IntegriCloud