Merging r169688: into 3.2 release branch.

PR14549. Don't assert if we see an incomplete decltype specifier at the end of the file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_32@169722 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp
index 4cb14e2..f11a9d1 100644
--- a/lib/Parse/ParseDeclCXX.cpp
+++ b/lib/Parse/ParseDeclCXX.cpp
@@ -706,8 +706,7 @@
       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.
diff --git a/test/Parser/bracket-crash.cpp b/test/Parser/bracket-crash.cpp
index bcc6eab..93b5294 100644
--- a/test/Parser/bracket-crash.cpp
+++ b/test/Parser/bracket-crash.cpp
@@ -4,3 +4,6 @@
 struct{
   a
 }
+
+// PR14549. Must be at end of file.
+decltype(