diff options
author | Anders Carlsson <andersca@mac.com> | 2011-03-25 14:46:08 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2011-03-25 14:46:08 +0000 |
commit | b184a18a0a52e4bec33ef70f13bfcc29aafa14f2 (patch) | |
tree | 638ac8b74d01b707d70937d98e6633d17a42c82d /lib/Parse/ParseDeclCXX.cpp | |
parent | 2c3ee54e51d835a35bbf781c69e17f39e2ba0480 (diff) |
Replace the call to ParseOptionalCXX0XClassVirtSpecifierSeq with code to only parse an optional 'final' keyword.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128278 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDeclCXX.cpp')
-rw-r--r-- | lib/Parse/ParseDeclCXX.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index 988ac84223..05253f6734 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/lib/Parse/ParseDeclCXX.cpp @@ -1758,8 +1758,24 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc, if (TagDecl) Actions.ActOnTagStartDefinition(getCurScope(), TagDecl); - ClassVirtSpecifiers CVS; - ParseOptionalCXX0XClassVirtSpecifierSeq(CVS); + SourceLocation FinalLoc; + + // Parse the optional 'final' keyword. + if (getLang().CPlusPlus && Tok.is(tok::identifier)) { + IdentifierInfo *II = Tok.getIdentifierInfo(); + + // Initialize the contextual keywords. + if (!Ident_final) { + Ident_final = &PP.getIdentifierTable().get("final"); + Ident_override = &PP.getIdentifierTable().get("override"); + } + + if (II == Ident_final) + FinalLoc = ConsumeToken(); + + if (!getLang().CPlusPlus0x) + Diag(FinalLoc, diag::ext_override_control_keyword) << "final"; + } if (Tok.is(tok::colon)) { ParseBaseClause(TagDecl); @@ -1777,9 +1793,6 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc, SourceLocation LBraceLoc = ConsumeBrace(); - SourceLocation FinalLoc = - CVS.isFinalSpecified() ? CVS.getFinalLoc() : SourceLocation(); - if (TagDecl) Actions.ActOnStartCXXMemberDeclarations(getCurScope(), TagDecl, FinalLoc, LBraceLoc); |