summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-04-05 06:32:51 +0000
committerChris Lattner <sabre@nondot.org>2008-04-05 06:32:51 +0000
commit9d51f2b9d44563a57aae5e5989c80dda8cde1d58 (patch)
tree745bf6d782d5106853716d53d1cf25c76ed63a59 /clang/test/Sema
parent94fc8063b4e4635bd18ea2b9cf76b4a71685b5ca (diff)
downloadbcm5719-llvm-9d51f2b9d44563a57aae5e5989c80dda8cde1d58.tar.gz
bcm5719-llvm-9d51f2b9d44563a57aae5e5989c80dda8cde1d58.zip
Fix handling of implicit int, resolving PR2012 and reverting (and
subsuming) my patch for PR1999. llvm-svn: 49251
Diffstat (limited to 'clang/test/Sema')
-rw-r--r--clang/test/Sema/c89.c10
-rw-r--r--clang/test/Sema/function.c2
2 files changed, 10 insertions, 2 deletions
diff --git a/clang/test/Sema/c89.c b/clang/test/Sema/c89.c
index 301ec374db3..6a12f1cc568 100644
--- a/clang/test/Sema/c89.c
+++ b/clang/test/Sema/c89.c
@@ -36,6 +36,14 @@ int *__restrict; /* expected-error {{expected identifier}} */
/* Implicit int, always ok */
-foo() {}
+test6() {}
+
+/* PR2012 */
+test7; /* expected-warning {{declaration specifier missing, defaulting to 'int'}} */
+
+void test8(int, x); /* expected-warning {{declaration specifier missing, defaulting to 'int'}} */
+
+typedef int sometype;
+int a(sometype, y) {return 0;} /* expected-warning {{declaration specifier missing, defaulting to 'int'}} */
diff --git a/clang/test/Sema/function.c b/clang/test/Sema/function.c
index 2a18dbb7050..152205dd244 100644
--- a/clang/test/Sema/function.c
+++ b/clang/test/Sema/function.c
@@ -18,7 +18,7 @@ void h (const char *fmt, ...) {} //expected-error{{conflicting types for 'h'}}
// PR1965
int t5(b); // expected-error {{parameter list without types}}
-int t6(int x, g); // expected-warning {{type specifier required for parameter 'g'}}
+int t6(int x, g); // expected-warning {{type specifier missing, defaults to 'int'}}
int t7(, ); // expected-error {{expected parameter declarator}} expected-error {{expected parameter declarator}}
int t8(, int a); // expected-error {{expected parameter declarator}}
OpenPOWER on IntegriCloud