diff options
author | John McCall <rjmccall@apple.com> | 2010-02-26 08:45:28 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-02-26 08:45:28 +0000 |
commit | 1f476a1783d95d9b53b10f763789e8afeded42f3 (patch) | |
tree | ef4171febd99b0f182fd41f0569b0f83d1b006bc /clang/lib/Parse/ParseDeclCXX.cpp | |
parent | 663f658d87961061a191611ce4a8ec3f32df296f (diff) | |
download | bcm5719-llvm-1f476a1783d95d9b53b10f763789e8afeded42f3.tar.gz bcm5719-llvm-1f476a1783d95d9b53b10f763789e8afeded42f3.zip |
Fix an assertion-on-error during tentative constructor parsing by
propagating error conditions out of the various annotate-me-a-snowflake
routines. Generally (but not universally) removes redundant diagnostics
as well as, you know, not crashing on bad code. On the other hand,
I have just signed myself up to fix fiddly parser errors for the next
week. Again.
llvm-svn: 97221
Diffstat (limited to 'clang/lib/Parse/ParseDeclCXX.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDeclCXX.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp index 225ce256b11..dbbfb9518b3 100644 --- a/clang/lib/Parse/ParseDeclCXX.cpp +++ b/clang/lib/Parse/ParseDeclCXX.cpp @@ -645,7 +645,8 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, // "FOO : BAR" is not a potential typo for "FOO::BAR". ColonProtectionRAIIObject X(*this); - if (ParseOptionalCXXScopeSpecifier(SS, /*ObjectType=*/0, true)) + ParseOptionalCXXScopeSpecifier(SS, /*ObjectType=*/0, true); + if (SS.isSet()) if (Tok.isNot(tok::identifier) && Tok.isNot(tok::annot_template_id)) Diag(Tok, diag::err_expected_ident); } @@ -1163,7 +1164,7 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS, // Access declarations. if (!TemplateInfo.Kind && (Tok.is(tok::identifier) || Tok.is(tok::coloncolon)) && - TryAnnotateCXXScopeToken() && + !TryAnnotateCXXScopeToken() && Tok.is(tok::annot_cxxscope)) { bool isAccessDecl = false; if (NextToken().is(tok::identifier)) |