diff options
Diffstat (limited to 'test/SemaCXX/function-redecl.cpp')
-rw-r--r-- | test/SemaCXX/function-redecl.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/SemaCXX/function-redecl.cpp b/test/SemaCXX/function-redecl.cpp index 2bc0d90cd6277..f91e670c0c31c 100644 --- a/test/SemaCXX/function-redecl.cpp +++ b/test/SemaCXX/function-redecl.cpp @@ -7,7 +7,7 @@ namespace N { void bar(int); // expected-note 2{{previous declaration is here}} } - void foo(int); // expected-note 2{{previous declaration is here}} + void foo(int); // expected-note 3{{previous declaration is here}} void f2() { int foo(int); // expected-error {{functions that differ only in their return type cannot be overloaded}} @@ -25,6 +25,13 @@ namespace N { } } } + + void f3() { + int foo(float); + { + float foo(int); // expected-error {{functions that differ only in their return type cannot be overloaded}} + } + } } class A { |