diff options
Diffstat (limited to 'clang/test/Sema/function-redecl.c')
-rw-r--r-- | clang/test/Sema/function-redecl.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/clang/test/Sema/function-redecl.c b/clang/test/Sema/function-redecl.c index 4be03227227..daa5044dd08 100644 --- a/clang/test/Sema/function-redecl.c +++ b/clang/test/Sema/function-redecl.c @@ -58,3 +58,31 @@ void test2() { } } } + +// <rdar://problem/6127293> +int outer1(int); // expected-note{{previous declaration is here}} +struct outer3 { }; +int outer4(int); +int outer5; // expected-note{{previous definition is here}} +int *outer7(int); + +void outer_test() { + int outer1(float); // expected-error{{conflicting types for 'outer1'}} + int outer2(int); // expected-note{{previous declaration is here}} + int outer3(int); // expected-note{{previous declaration is here}} + int outer4(int); // expected-note{{previous declaration is here}} + int outer5(int); // expected-error{{redefinition of 'outer5' as different kind of symbol}} + int* outer6(int); // expected-note{{previous declaration is here}} + int *outer7(int); + + int *ip7 = outer7(6); +} + +int outer2(float); // expected-error{{conflicting types for 'outer2'}} +int outer3(float); // expected-error{{conflicting types for 'outer3'}} +int outer4(float); // expected-error{{conflicting types for 'outer4'}} + +void outer_test2(int x) { + int* ip = outer6(x); // expected-warning{{use of out-of-scope declaration of 'outer6'}} + int *ip2 = outer7(x); +} |