[cfe-commits] r169688 - in /cfe/trunk: lib/Parse/ParseDeclCXX.cpp test/Parser/bracket-crash.cpp
Richard Smith
richard-llvm at metafoo.co.uk
Sat Dec 8 20:17:57 PST 2012
Author: rsmith
Date: Sat Dec 8 22:17:57 2012
New Revision: 169688
URL: http://llvm.org/viewvc/llvm-project?rev=169688&view=rev
Log:
PR14549. Don't assert if we see an incomplete decltype specifier at the end of the file.
Modified:
cfe/trunk/lib/Parse/ParseDeclCXX.cpp
cfe/trunk/test/Parser/bracket-crash.cpp
Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=169688&r1=169687&r2=169688&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Sat Dec 8 22:17:57 2012
@@ -707,8 +707,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.
Modified: cfe/trunk/test/Parser/bracket-crash.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/bracket-crash.cpp?rev=169688&r1=169687&r2=169688&view=diff
==============================================================================
--- cfe/trunk/test/Parser/bracket-crash.cpp (original)
+++ cfe/trunk/test/Parser/bracket-crash.cpp Sat Dec 8 22:17:57 2012
@@ -4,3 +4,6 @@
struct{
a
}
+
+// PR14549. Must be at end of file.
+decltype(
More information about the cfe-commits
mailing list