summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/function-redecl.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Sema/function-redecl.c')
-rw-r--r--clang/test/Sema/function-redecl.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/clang/test/Sema/function-redecl.c b/clang/test/Sema/function-redecl.c
index 85663396cf3..4be03227227 100644
--- a/clang/test/Sema/function-redecl.c
+++ b/clang/test/Sema/function-redecl.c
@@ -28,3 +28,33 @@ INT g2(x) // expected-error{{conflicting types for 'g2'}}
{
return x;
}
+
+void test() {
+ int f1;
+ {
+ void f1(double);
+ {
+ void f1(double); // expected-note{{previous declaration is here}}
+ {
+ int f1(int); // expected-error{{conflicting types for 'f1'}}
+ }
+ }
+ }
+}
+
+extern void g3(int); // expected-note{{previous declaration is here}}
+static void g3(int x) { } // expected-error{{static declaration of 'g3' follows non-static declaration}}
+
+void test2() {
+ extern int f2; // expected-note{{previous definition is here}}
+ {
+ void f2(int); // expected-error{{redefinition of 'f2' as different kind of symbol}}
+ }
+
+ {
+ int f2;
+ {
+ void f2(int); // okay
+ }
+ }
+}
OpenPOWER on IntegriCloud