diff options
author | Chris Lattner <sabre@nondot.org> | 2010-05-14 17:44:56 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-05-14 17:44:56 +0000 |
commit | 9a65b8110595b10f7017173db3d69b3371c8e685 (patch) | |
tree | 3f22c255b35ade1ddfbc933779e13b2b59dd8871 /lib/CodeGen/CodeGenFunction.h | |
parent | 321c2688198f6f1a4086964e505f239683423cec (diff) |
Improve error recovery in C/ObjC when the first argument of a function
declarator is incorrect. Not being a typename causes the parser to
dive down into the K&R identifier list handling stuff, which is almost
never the right thing to do.
Before:
r.c:3:17: error: expected ')'
void bar(intptr y);
^
r.c:3:9: note: to match this '('
void bar(intptr y);
^
r.c:3:10: error: a parameter list without types is only allowed in a function definition
void bar(intptr y);
^
After:
r.c:3:10: error: unknown type name 'intptr'; did you mean 'intptr_t'?
void bar(intptr y);
^~~~~~
intptr_t
r.c:1:13: note: 'intptr_t' declared here
typedef int intptr_t;
^
This fixes rdar://7980651 - poor recovery for bad type in the first arg of a C function
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103783 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.h')
0 files changed, 0 insertions, 0 deletions