xref: /llvm-project/clang/test/CXX/over/over.over/p4.cpp (revision b491ed36b4ef9943e21fb47405b5ed8bea412b99)
18fbe78f6SDaniel Dunbar // RUN: %clang_cc1 -fsyntax-only -verify %s
2b257e4ffSDouglas Gregor 
3*b491ed36SDouglas Gregor template<typename T> T f0(T); // expected-note{{candidate function}}
4b257e4ffSDouglas Gregor int f0(int); // expected-note{{candidate function}}
5b257e4ffSDouglas Gregor 
test_f0()6b257e4ffSDouglas Gregor void test_f0() {
7b257e4ffSDouglas Gregor   int (*fp0)(int) = f0;
8b257e4ffSDouglas Gregor   int (*fp1)(int) = &f0;
9b257e4ffSDouglas Gregor   float (*fp2)(float) = &f0;
10b257e4ffSDouglas Gregor }
11b257e4ffSDouglas Gregor 
12b257e4ffSDouglas Gregor namespace N {
13b257e4ffSDouglas Gregor   int f0(int); // expected-note{{candidate function}}
14b257e4ffSDouglas Gregor }
15b257e4ffSDouglas Gregor 
test_f0_2()16b257e4ffSDouglas Gregor void test_f0_2() {
17b257e4ffSDouglas Gregor   using namespace N;
18e81f58e1SDouglas Gregor   int (*fp0)(int) = f0; // expected-error{{address of overloaded function 'f0' is ambiguous}}
19b257e4ffSDouglas Gregor   float (*fp1)(float) = f0;
20b257e4ffSDouglas Gregor }
21