[cfe-commits] r151515 - in /cfe/trunk: lib/Parse/ParseDeclCXX.cpp test/Parser/bracket-crash.cpp
Richard Smith
richard-llvm at metafoo.co.uk
Sun Feb 26 21:24:00 PST 2012
Author: rsmith
Date: Sun Feb 26 23:24:00 2012
New Revision: 151515
URL: http://llvm.org/viewvc/llvm-project?rev=151515&view=rev
Log:
Fix decltype crash-on-invalid, if we don't find a matching ')' for an ill-formed
decltype expression.
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=151515&r1=151514&r2=151515&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Sun Feb 26 23:24:00 2012
@@ -674,9 +674,9 @@
0, /*IsDecltype=*/true);
Result = ParseExpression();
if (Result.isInvalid()) {
- SkipUntil(tok::r_paren, true, true);
+ SkipUntil(tok::r_paren);
DS.SetTypeSpecError();
- return Tok.is(tok::eof) ? Tok.getLocation() : ConsumeParen();
+ return StartLoc;
}
// Match the ')'
Modified: cfe/trunk/test/Parser/bracket-crash.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/bracket-crash.cpp?rev=151515&r1=151514&r2=151515&view=diff
==============================================================================
--- cfe/trunk/test/Parser/bracket-crash.cpp (original)
+++ cfe/trunk/test/Parser/bracket-crash.cpp Sun Feb 26 23:24:00 2012
@@ -1,6 +1,6 @@
-// RUN: not %clang_cc1 -fsyntax-only %s
+// RUN: not %clang_cc1 -fsyntax-only -std=c++11 %s
// PR7481
+decltype(;
struct{
a
}
-
More information about the cfe-commits
mailing list