[cfe-commits] r43349 - in /cfe/trunk: Parse/ParseInit.cpp test/Parser/recovery-1.c
Chris Lattner
sabre at nondot.org
Thu Oct 25 10:27:01 PDT 2007
Author: lattner
Date: Thu Oct 25 12:27:01 2007
New Revision: 43349
URL: http://llvm.org/viewvc/llvm-project?rev=43349&view=rev
Log:
Fix a recovery bug Fariborz and I noticed yesterday. We were producing:
method.c:4:3: error: use of undeclared identifier 'BADIDENT'
&BADIDENT, 0
^
method.c:5:2: error: expected '}'
};
^
method.c:3:14: error: to match this '{'
struct S A = {
^
now we only produce:
method.c:4:3: error: use of undeclared identifier 'BADIDENT'
&BADIDENT, 0
^
Modified:
cfe/trunk/Parse/ParseInit.cpp
cfe/trunk/test/Parser/recovery-1.c
Modified: cfe/trunk/Parse/ParseInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Parse/ParseInit.cpp?rev=43349&r1=43348&r2=43349&view=diff
==============================================================================
--- cfe/trunk/Parse/ParseInit.cpp (original)
+++ cfe/trunk/Parse/ParseInit.cpp Thu Oct 25 12:27:01 2007
@@ -175,7 +175,7 @@
// If we couldn't parse the subelement, bail out.
if (SubElt.isInvalid) {
InitExprsOk = false;
- SkipUntil(tok::r_brace);
+ SkipUntil(tok::r_brace, false, true);
break;
} else
InitExprs.push_back(SubElt.Val);
Modified: cfe/trunk/test/Parser/recovery-1.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/recovery-1.c?rev=43349&r1=43348&r2=43349&view=diff
==============================================================================
--- cfe/trunk/test/Parser/recovery-1.c (original)
+++ cfe/trunk/test/Parser/recovery-1.c Thu Oct 25 12:27:01 2007
@@ -5,3 +5,12 @@
*X x ] )))); /* expected-error {{expected ')'}} */
; // expected-warning {{ISO C does not allow an extra ';' outside of a function}}
+
+
+
+
+struct S { void *X, *Y; };
+
+struct S A = {
+ &BADIDENT, 0 /* expected-error {{use of undeclared identifier}} */
+};
More information about the cfe-commits
mailing list