diff options
author | Chris Lattner <sabre@nondot.org> | 2010-07-11 22:42:07 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-07-11 22:42:07 +0000 |
commit | 1390134c1804d6356ebcfdf8ce48fb747e03f250 (patch) | |
tree | 27f73722fa5f8840c894b424633a9c26f39185e6 /clang/test/Parser/declarators.c | |
parent | dbb1e93a9fc79d136ffbaea0dbe5342785ab9d2e (diff) | |
download | bcm5719-llvm-1390134c1804d6356ebcfdf8ce48fb747e03f250.tar.gz bcm5719-llvm-1390134c1804d6356ebcfdf8ce48fb747e03f250.zip |
Fix PR7617 by not entering ParseFunctionDefinition when
a function prototype is followed by a declarator if we
aren't parsing a K&R style identifier list.
Also, avoid skipping randomly after a declaration if a
semicolon is missing. Before we'd get:
t.c:3:1: error: expected function body after function declarator
void bar();
^
Now we get:
t.c:1:11: error: invalid token after top level declarator
void foo()
^
;
llvm-svn: 108105
Diffstat (limited to 'clang/test/Parser/declarators.c')
-rw-r--r-- | clang/test/Parser/declarators.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/Parser/declarators.c b/clang/test/Parser/declarators.c index a82122ec35f..0e6f8bcf28f 100644 --- a/clang/test/Parser/declarators.c +++ b/clang/test/Parser/declarators.c @@ -86,3 +86,11 @@ struct test13 { int a; } (test13x); // <rdar://problem/8044088> struct X<foo::int> { }; // expected-error{{expected identifier or '('}} + + +// PR7617 - error recovery on missing ;. + +void test14() // expected-error {{invalid token after top level declarator}} + +void test14a(); +void *test14b = (void*)test14a; // Make sure test14a didn't get skipped. |