aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/invalid-decl.c
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-02-22 06:58:32 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-02-22 06:58:32 +0000
commitd5668a2447c2afeea38815b51a80a5a6ac235599 (patch)
tree3c96839e397d512441ad18569f5ac358291e010e /test/Sema/invalid-decl.c
parent28965bfa833926fd908a902cf2373d07c47b9067 (diff)
When a parameter list in a C function has an error, recover by forming a K&R function,
instead of a non-function type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175868 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/invalid-decl.c')
-rw-r--r--test/Sema/invalid-decl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/Sema/invalid-decl.c b/test/Sema/invalid-decl.c
index b2c2aaf1a0..4e628817d2 100644
--- a/test/Sema/invalid-decl.c
+++ b/test/Sema/invalid-decl.c
@@ -38,3 +38,7 @@ static void bar(hid_t p, char); // expected-error {{unknown type name 'hid_t'}}
void foo() {
(void)bar;
}
+
+void test2();
+void test2(undef); // expected-error {{a parameter list without types is only allowed in a function definition}}
+void test2() { }