diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2010-02-03 21:21:43 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2010-02-03 21:21:43 +0000 |
commit | d9bafa76f8d6eb9e4f4974ed322217f8df6bb82e (patch) | |
tree | 9cf872e4c9dda96f96407751cc0e07a322074121 /lib/Parse/ParseDecl.cpp | |
parent | 3d0ad58b28e0d50fca7f21c6a078b05370510288 (diff) |
In some contexts, type declarations cannot occur. Pass this information down to ParseClassSpecifier, to make its decision easier. Fixes PR6200.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95255 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 5a5f5092db..9960238300 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -1398,7 +1398,8 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, bool Parser::ParseOptionalTypeSpecifier(DeclSpec &DS, bool& isInvalid, const char *&PrevSpec, unsigned &DiagID, - const ParsedTemplateInfo &TemplateInfo) { + const ParsedTemplateInfo &TemplateInfo, + bool SuppressDeclarations) { SourceLocation Loc = Tok.getLocation(); switch (Tok.getKind()) { @@ -1408,7 +1409,7 @@ bool Parser::ParseOptionalTypeSpecifier(DeclSpec &DS, bool& isInvalid, // recurse to handle whatever we get. if (TryAnnotateTypeOrScopeToken()) return ParseOptionalTypeSpecifier(DS, isInvalid, PrevSpec, DiagID, - TemplateInfo); + TemplateInfo, SuppressDeclarations); // Otherwise, not a type specifier. return false; case tok::coloncolon: // ::foo::bar @@ -1420,7 +1421,7 @@ bool Parser::ParseOptionalTypeSpecifier(DeclSpec &DS, bool& isInvalid, // recurse to handle whatever we get. if (TryAnnotateTypeOrScopeToken()) return ParseOptionalTypeSpecifier(DS, isInvalid, PrevSpec, DiagID, - TemplateInfo); + TemplateInfo, SuppressDeclarations); // Otherwise, not a type specifier. return false; @@ -1526,7 +1527,8 @@ bool Parser::ParseOptionalTypeSpecifier(DeclSpec &DS, bool& isInvalid, case tok::kw_union: { tok::TokenKind Kind = Tok.getKind(); ConsumeToken(); - ParseClassSpecifier(Kind, Loc, DS, TemplateInfo); + ParseClassSpecifier(Kind, Loc, DS, TemplateInfo, AS_none, + SuppressDeclarations); return true; } |