// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s template struct A { A(); }; template int &f(T); template float &f(T*); template double &f(const T*); template void g(T); // expected-note{{candidate}} template void g(T&); // expected-note{{candidate}} template int &h(const T&); template float &h(A&); void m() { const int *p; double &dr1 = f(p); float x; g(x); // expected-error{{ambiguous}} A z; float &fr1 = h(z); const A z2; int &ir1 = h(z2); } namespace core_26909 { template struct A {}; template void f(T&, U); // expected-note {{candidate}} template void f(T&&, A); // expected-note {{candidate}} expected-warning 0-1{{extension}} template void g(const T&, U); // expected-note {{candidate}} template void g(T&, A); // expected-note {{candidate}} void h(int a, const char b, A c) { f(a, c); // expected-error{{ambiguous}} g(b, c); // expected-error{{ambiguous}} } } namespace PR22435 { template void foo(void (*)(T), const U &); // expected-note {{candidate}} template bool foo(void (*)(T &), U &); // expected-note {{candidate}} void bar(const int x) { bool b = foo(0, x); } // expected-error {{ambiguous}} }