diff options
author | Nico Weber <nicolasweber@gmx.de> | 2015-02-02 05:33:50 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2015-02-02 05:33:50 +0000 |
commit | 7f8ec52067af9cfb9568faf7fdcf8b6ed29cf8c7 (patch) | |
tree | 3a96d6633575eb8e41891c197cf638ddf35b2bb1 /clang/lib/Parse/ParseExprCXX.cpp | |
parent | 16bbaf16397a91da98ebca9310e5a611265053c3 (diff) | |
download | bcm5719-llvm-7f8ec52067af9cfb9568faf7fdcf8b6ed29cf8c7.tar.gz bcm5719-llvm-7f8ec52067af9cfb9568faf7fdcf8b6ed29cf8c7.zip |
Follow-up to r217302: Don't crash on ~A::A in a postfix expr suffix followed by '<'.
This used to crash, complaining "ObjectType and scope specifier cannot coexist":
struct A { } b = b.~A::A <int>;
The only other caller of ParseOptionalCXXScopeSpecifier() that passes in a
non-empty ObjectType clears the ObjectType of the scope specifier comes back
non-empty (see the tok::period case in Parser::ParsePostfixExpressionSuffix()),
so do that here too.
Found by SLi's bot.
llvm-svn: 227781
Diffstat (limited to 'clang/lib/Parse/ParseExprCXX.cpp')
-rw-r--r-- | clang/lib/Parse/ParseExprCXX.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseExprCXX.cpp b/clang/lib/Parse/ParseExprCXX.cpp index 506e13ac4ba..10ae450fe89 100644 --- a/clang/lib/Parse/ParseExprCXX.cpp +++ b/clang/lib/Parse/ParseExprCXX.cpp @@ -2521,6 +2521,8 @@ bool Parser::ParseUnqualifiedId(CXXScopeSpec &SS, bool EnteringContext, } if (ParseOptionalCXXScopeSpecifier(SS, ObjectType, EnteringContext)) return true; + if (SS.isNotEmpty()) + ObjectType = ParsedType(); if (Tok.isNot(tok::identifier) || NextToken().is(tok::coloncolon) || SS.isInvalid()) { Diag(TildeLoc, diag::err_destructor_tilde_scope); |