Refactor: remove redundant check for 'final' specifier when parsing class/struct definition.

llvm-svn: 142054
This commit is contained in:
Richard Smith 2011-10-15 04:21:46 +00:00
parent 6b46488ff2
commit da2611199b
1 changed files with 4 additions and 13 deletions

View File

@ -2072,20 +2072,11 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
// Parse the optional 'final' keyword.
if (getLang().CPlusPlus && Tok.is(tok::identifier)) {
IdentifierInfo *II = Tok.getIdentifierInfo();
assert(isCXX0XFinalKeyword() && "not a class definition");
FinalLoc = ConsumeToken();
// 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 (!getLang().CPlusPlus0x)
Diag(FinalLoc, diag::ext_override_control_keyword) << "final";
}
if (Tok.is(tok::colon)) {