summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-02-10 23:08:00 +0000
committerChris Lattner <sabre@nondot.org>2008-02-10 23:08:00 +0000
commit7b8134f5c6ad8b87781881ceb81f619533230699 (patch)
tree2d80b75258cd648215adc166b11ef4d37d182e5a /clang/test
parent15888c23f5841d25b01333d0806d272ede734fd9 (diff)
downloadbcm5719-llvm-7b8134f5c6ad8b87781881ceb81f619533230699.tar.gz
bcm5719-llvm-7b8134f5c6ad8b87781881ceb81f619533230699.zip
Fix PR1999, by emitting a hard error only if an argument declarator is completely
missing. Otherwise, it is an implicit int case, which is valid in c90 and invalid elsewhere, but accepted as an extension. llvm-svn: 46938
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Parser/declarators.c4
-rw-r--r--clang/test/Sema/c89.c3
-rw-r--r--clang/test/Sema/function.c10
3 files changed, 10 insertions, 7 deletions
diff --git a/clang/test/Parser/declarators.c b/clang/test/Parser/declarators.c
index e00035c8e0f..aaea35c2cbc 100644
--- a/clang/test/Parser/declarators.c
+++ b/clang/test/Parser/declarators.c
@@ -1,4 +1,4 @@
-// RUN: clang %s -fsyntax-only -verify
+// RUN: clang %s -fsyntax-only -verify -pedantic
extern int a1[];
@@ -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-error {{type specifier required}} */
+int f4(*XX)(void); /* expected-error {{cannot return}} expected-warning {{type specifier required}} */
char ((((*X))));
diff --git a/clang/test/Sema/c89.c b/clang/test/Sema/c89.c
index 7f26e99dfa8..e7568bcb1b7 100644
--- a/clang/test/Sema/c89.c
+++ b/clang/test/Sema/c89.c
@@ -27,3 +27,6 @@ void test3(int i) {
int test4 = 0LL; /* expected-warning {{long long}} */
+/* PR1999 */
+void test5(register);
+
diff --git a/clang/test/Sema/function.c b/clang/test/Sema/function.c
index 7e593d400c9..a75814ee45e 100644
--- a/clang/test/Sema/function.c
+++ b/clang/test/Sema/function.c
@@ -1,4 +1,4 @@
-// RUN: clang %s -fsyntax-only -verify
+// RUN: clang %s -fsyntax-only -verify -pedantic
// PR1892
void f(double a[restrict][5]); // should promote to restrict ptr.
void f(double (* restrict a)[5]);
@@ -16,10 +16,10 @@ void g(int (*compar)()) {
// PR1965
int t5(b); // expected-error {{parameter list without types}}
-int t6(int x, g); // expected-error {{type specifier required for parameter 'g'}}
+int t6(int x, g); // expected-warning {{type specifier required for parameter 'g'}}
-int t7(, ); // expected-error {{type specifier required}} expected-error {{type specifier required}}
-int t8(, int a); // expected-error {{type specifier required}}
-int t9(int a, ); // expected-error {{type specifier required}}
+int t7(, ); // expected-error {{expected parameter declarator}} expected-error {{expected parameter declarator}}
+int t8(, int a); // expected-error {{expected parameter declarator}}
+int t9(int a, ); // expected-error {{expected parameter declarator}}
OpenPOWER on IntegriCloud