diff options
author | Chris Lattner <sabre@nondot.org> | 2009-04-12 20:42:31 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-04-12 20:42:31 +0000 |
commit | c199ab3ea1381e8e9cdd720eb87bb4f65cdf5086 (patch) | |
tree | d43a64f374cff68ec50cd11f12f0787ebbc85add /lib/CodeGen/CodeGenTypes.h | |
parent | 20401698e3bd93a24bb5d9e18e435895cefe5fd1 (diff) |
Implement the first set of changes for PR3963 and rdar://6759604,
which tries to do better error recovery when it is "obvious" that an
identifier is a mis-typed typename. In this case, we try to parse
it as a typename instead of as the identifier in a declarator, which
gives us several options for better error recovery and immediately
makes diagnostics more useful. For example, we now produce:
t.c:4:8: error: unknown type name 'foo_t'
static foo_t a = 4;
^
instead of:
t.c:4:14: error: invalid token after top level declarator
static foo_t a = 4;
^
Also, since we now parse "a" correctly, we make a decl for it,
preventing later uses of 'a' from emitting things like:
t.c:12:20: error: use of undeclared identifier 'a'
int bar() { return a + b; }
^
I'd really appreciate any scrutiny possible on this, it
is a tricky area.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68911 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenTypes.h')
0 files changed, 0 insertions, 0 deletions