summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/function-redecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaCXX/function-redecl.cpp')
-rw-r--r--clang/test/SemaCXX/function-redecl.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/clang/test/SemaCXX/function-redecl.cpp b/clang/test/SemaCXX/function-redecl.cpp
index b9d1f23af40..deb8e9d37fd 100644
--- a/clang/test/SemaCXX/function-redecl.cpp
+++ b/clang/test/SemaCXX/function-redecl.cpp
@@ -4,22 +4,27 @@ int foo(int);
namespace N {
void f1() {
void foo(int); // okay
+ void bar(int);
}
- // FIXME: we shouldn't even need this declaration to detect errors
- // below.
- void foo(int); // expected-note{{previous declaration is here}}
+ void foo(int); // expected-note 2{{previous declaration is here}}
void f2() {
- int foo(int); // expected-error{{functions that differ only in their return type cannot be overloaded}}
+ int foo(int); // expected-error {{functions that differ only in their return type cannot be overloaded}}
+ // FIXME: We should be able to diagnose the conflict between this
+ // declaration of 'bar' and the previous one, even though they come
+ // from different lexical scopes.
+ int bar(int); // expected-note {{previous declaration is here}}
+ int baz(int); // expected-note {{previous declaration is here}}
{
int foo;
+ int bar;
+ int baz;
{
- // FIXME: should diagnose this because it's incompatible with
- // N::foo. However, name lookup isn't properly "skipping" the
- // "int foo" above.
- float foo(int);
+ float foo(int); // expected-error {{functions that differ only in their return type cannot be overloaded}}
+ float bar(int); // expected-error {{functions that differ only in their return type cannot be overloaded}}
+ float baz(int); // expected-error {{functions that differ only in their return type cannot be overloaded}}
}
}
}
OpenPOWER on IntegriCloud