summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Sema')
-rw-r--r--clang/test/Sema/function-redecl.c4
-rw-r--r--clang/test/Sema/var-redecl.c21
2 files changed, 23 insertions, 2 deletions
diff --git a/clang/test/Sema/function-redecl.c b/clang/test/Sema/function-redecl.c
index daa5044dd08..e8252db343d 100644
--- a/clang/test/Sema/function-redecl.c
+++ b/clang/test/Sema/function-redecl.c
@@ -46,7 +46,7 @@ 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}}
+ extern int f2; // expected-note 2 {{previous definition is here}}
{
void f2(int); // expected-error{{redefinition of 'f2' as different kind of symbol}}
}
@@ -54,7 +54,7 @@ void test2() {
{
int f2;
{
- void f2(int); // okay
+ void f2(int); // expected-error{{redefinition of 'f2' as different kind of symbol}}
}
}
}
diff --git a/clang/test/Sema/var-redecl.c b/clang/test/Sema/var-redecl.c
index 9abe2731c08..317a0f578f6 100644
--- a/clang/test/Sema/var-redecl.c
+++ b/clang/test/Sema/var-redecl.c
@@ -28,3 +28,24 @@ float outer4; // expected-error{{redefinition of 'outer4' with a different type}
float outer5; // expected-error{{redefinition of 'outer5' with a different type}}
int outer8(int); // expected-error{{redefinition of 'outer8' as different kind of symbol}}
float outer9; // expected-error{{redefinition of 'outer9' with a different type}}
+
+extern int outer13; // expected-note{{previous definition is here}}
+void outer_shadowing_test() {
+ extern int outer10;
+ extern int outer11; // expected-note{{previous definition is here}}
+ extern int outer12; // expected-note{{previous definition is here}}
+ {
+ float outer10;
+ float outer11;
+ float outer12;
+ {
+ extern int outer10; // okay
+ extern float outer11; // expected-error{{redefinition of 'outer11' with a different type}}
+ static double outer12;
+ {
+ extern float outer12; // expected-error{{redefinition of 'outer12' with a different type}}
+ extern float outer13; // expected-error{{redefinition of 'outer13' with a different type}}
+ }
+ }
+ }
+}
OpenPOWER on IntegriCloud