diff options
author | Serge Pavlov <sepavloff@gmail.com> | 2015-06-29 17:50:19 +0000 |
---|---|---|
committer | Serge Pavlov <sepavloff@gmail.com> | 2015-06-29 17:50:19 +0000 |
commit | 3739f5e7c9d33d0ceed7f849505a91efa01294c5 (patch) | |
tree | 8279b1818069e4aedc926690282f42c2cc6817b5 /clang/lib/Parse | |
parent | ae51f5bab147fffbb82756d4216a7ae2606118eb (diff) | |
download | bcm5719-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.cpp | 9 |
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; |