summaryrefslogtreecommitdiffstats
path: root/clang/test
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
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')
-rw-r--r--clang/test/Parser/declarators.c2
-rw-r--r--clang/test/Sema/c89.c10
-rw-r--r--clang/test/Sema/function.c2
3 files changed, 11 insertions, 3 deletions
diff --git a/clang/test/Parser/declarators.c b/clang/test/Parser/declarators.c
index aaea35c2cbc..15ae7c6b577 100644
--- a/clang/test/Parser/declarators.c
+++ b/clang/test/Parser/declarators.c
@@ -6,7 +6,7 @@ void f0();
void f1(int [*]);
void f2(int [const *]);
void f3(int [volatile const*]);
-int f4(*XX)(void); /* expected-error {{cannot return}} expected-warning {{type specifier required}} */
+int f4(*XX)(void); /* expected-error {{cannot return}} expected-warning {{type specifier missing, defaults to 'int'}} */
char ((((*X))));
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