forked from OSchip/llvm-project
Don't warn about use of 'final' in ill-formed C++98 code which didn't use
'final', and don't accept (then silently discard) braced init lists in C++98 new-expressions. llvm-svn: 142048
This commit is contained in:
parent
27ef75b0be
commit
2db9652b5a
|
@ -2080,12 +2080,13 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
|
||||||
Ident_override = &PP.getIdentifierTable().get("override");
|
Ident_override = &PP.getIdentifierTable().get("override");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (II == Ident_final)
|
if (II == Ident_final) {
|
||||||
FinalLoc = ConsumeToken();
|
FinalLoc = ConsumeToken();
|
||||||
|
|
||||||
if (!getLang().CPlusPlus0x)
|
if (!getLang().CPlusPlus0x)
|
||||||
Diag(FinalLoc, diag::ext_override_control_keyword) << "final";
|
Diag(FinalLoc, diag::ext_override_control_keyword) << "final";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (Tok.is(tok::colon)) {
|
if (Tok.is(tok::colon)) {
|
||||||
ParseBaseClause(TagDecl);
|
ParseBaseClause(TagDecl);
|
||||||
|
|
|
@ -2103,7 +2103,7 @@ Parser::ParseCXXNewExpression(bool UseGlobal, SourceLocation Start) {
|
||||||
SkipUntil(tok::semi, /*StopAtSemi=*/true, /*DontConsume=*/true);
|
SkipUntil(tok::semi, /*StopAtSemi=*/true, /*DontConsume=*/true);
|
||||||
return ExprError();
|
return ExprError();
|
||||||
}
|
}
|
||||||
} else if (Tok.is(tok::l_brace)) {
|
} else if (Tok.is(tok::l_brace) && getLang().CPlusPlus0x) {
|
||||||
// FIXME: Have to communicate the init-list to ActOnCXXNew.
|
// FIXME: Have to communicate the init-list to ActOnCXXNew.
|
||||||
ParseBraceInitializer();
|
ParseBraceInitializer();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue