forked from OSchip/llvm-project
Refactor: remove redundant check for 'final' specifier when parsing class/struct definition.
llvm-svn: 142054
This commit is contained in:
parent
6b46488ff2
commit
da2611199b
|
@ -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();
|
||||
|
||||
// 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();
|
||||
assert(isCXX0XFinalKeyword() && "not a class definition");
|
||||
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)) {
|
||||
|
|
Loading…
Reference in New Issue