]> granicus.if.org Git - clang/commitdiff
PR14549. Don't assert if we see an incomplete decltype specifier at the end of the...
authorRichard Smith <richard-llvm@metafoo.co.uk>
Sun, 9 Dec 2012 04:17:57 +0000 (04:17 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Sun, 9 Dec 2012 04:17:57 +0000 (04:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169688 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseDeclCXX.cpp
test/Parser/bracket-crash.cpp

index 503d436c3bda2dcb945f296aa0fc52fafe02d096..2e7592f4dd9418ba987a2c8d0d42f0aa82887396 100644 (file)
@@ -707,8 +707,7 @@ SourceLocation Parser::ParseDecltypeSpecifier(DeclSpec &DS) {
       if (SkipUntil(tok::r_paren, /*StopAtSemi=*/true, /*DontConsume=*/true)) {
         EndLoc = ConsumeParen();
       } else {
-        assert(Tok.is(tok::semi));
-        if (PP.isBacktrackEnabled()) {
+        if (PP.isBacktrackEnabled() && Tok.is(tok::semi)) {
           // Backtrack to get the location of the last token before the semi.
           PP.RevertCachedTokens(2);
           ConsumeToken(); // the semi.
index bcc6eabc6e99c7e6ddc97678b7fd4f3ea5e624d9..93b52940773ded05e5a271a135d1568d2fd3f6d6 100644 (file)
@@ -4,3 +4,6 @@ decltype(;
 struct{
   a
 }
+
+// PR14549. Must be at end of file.
+decltype(