http://llvm.org/bugs/show_bug.cgi?id=3963
Summary: improve error recovery for mistyped "types"
Product: clang
Version: unspecified
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Semantic Analyzer
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Consider something like this where clang doesn't know foo_t is a type:
static foo_t x = 4;
we emit:
t2.c:2:14: error: invalid token after top level declarator
static foo_t x = 4;
^
and then errors at every use of X because it wasn't declared. Similarly for
things like "static foo_t *X etc.
In this case, the parser thinks it is seeing a declaration of a variable named
foo_t that is implicit int. In this case (when it is in implicit int mode) it
should do lookahead to see if the non-type token (which it thinks is the
identifier) is followed immediately by something that is not valid, e.g.
another identifier, a *, a &, etc. In this case, it should recover by parsing
foo_t as a broken type. This will lead to a much better diagnostic and will
squeltch the chain of bogus diagnostics at uses of X.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs