Fix a crash-on-invalid found by -Wlogical-op-parentheses.

llvm-svn: 152559
This commit is contained in:
David Blaikie
2012-03-12 15:39:49 +00:00
parent 2f48b870f3
commit 9933a5abab
2 changed files with 2 additions and 1 deletions

View File

@@ -1136,7 +1136,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
else if (Tok.is(tok::l_brace) ||
(getLangOpts().CPlusPlus && Tok.is(tok::colon)) ||
(isCXX0XFinalKeyword() &&
NextToken().is(tok::l_brace) || NextToken().is(tok::colon))) {
(NextToken().is(tok::l_brace) || NextToken().is(tok::colon)))) {
if (DS.isFriendSpecified()) {
// C++ [class.friend]p2:
// A class shall not be defined in a friend declaration.

View File

@@ -23,6 +23,7 @@ namespace final {
};
// This too.
struct T final : S {}; // expected-error {{base 'S' is marked 'final'}}
struct T bar : S {}; // expected-error {{expected ';' after top level declarator}} expected-error {{expected unqualified-id}}
}
}