]> granicus.if.org Git - clang/commitdiff
Fix a crash-on-invalid found by -Wlogical-op-parentheses.
authorDavid Blaikie <dblaikie@gmail.com>
Mon, 12 Mar 2012 15:39:49 +0000 (15:39 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Mon, 12 Mar 2012 15:39:49 +0000 (15:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152559 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseDeclCXX.cpp
test/Parser/cxx0x-ambig.cpp

index 979b4dd18fe230775340a42c800d9188c245e4f1..cf18a5b629402e4c7b4058b60358ccb076ad3b86 100644 (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.
index b77bae500edae99e2eb7032094253537ff28cf30..d4cbfeab75d80e609ab382330995dbc0e9312a64 100644 (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}}
   }
 }