1a5728872c7702ddd09537c95bc3cbd20e1f2fb09Daniel Dunbar// RUN: %clang_cc1 -fsyntax-only -verify %s 200aeb52314ec0b1902bb15aef9c62259296fbc29Douglas Gregor 31be8eec3ddd2a23c19b453c2639226174eb5d4a8Douglas Gregortemplate<typename T> T f0(T); // expected-note{{candidate function}} 400aeb52314ec0b1902bb15aef9c62259296fbc29Douglas Gregorint f0(int); // expected-note{{candidate function}} 500aeb52314ec0b1902bb15aef9c62259296fbc29Douglas Gregor 600aeb52314ec0b1902bb15aef9c62259296fbc29Douglas Gregorvoid test_f0() { 700aeb52314ec0b1902bb15aef9c62259296fbc29Douglas Gregor int (*fp0)(int) = f0; 800aeb52314ec0b1902bb15aef9c62259296fbc29Douglas Gregor int (*fp1)(int) = &f0; 900aeb52314ec0b1902bb15aef9c62259296fbc29Douglas Gregor float (*fp2)(float) = &f0; 1000aeb52314ec0b1902bb15aef9c62259296fbc29Douglas Gregor} 1100aeb52314ec0b1902bb15aef9c62259296fbc29Douglas Gregor 1200aeb52314ec0b1902bb15aef9c62259296fbc29Douglas Gregornamespace N { 1300aeb52314ec0b1902bb15aef9c62259296fbc29Douglas Gregor int f0(int); // expected-note{{candidate function}} 1400aeb52314ec0b1902bb15aef9c62259296fbc29Douglas Gregor} 1500aeb52314ec0b1902bb15aef9c62259296fbc29Douglas Gregor 1600aeb52314ec0b1902bb15aef9c62259296fbc29Douglas Gregorvoid test_f0_2() { 1700aeb52314ec0b1902bb15aef9c62259296fbc29Douglas Gregor using namespace N; 188e960435696b4ccf6a8ad0ed0530e3280b77af8bDouglas Gregor int (*fp0)(int) = f0; // expected-error{{address of overloaded function 'f0' is ambiguous}} 1900aeb52314ec0b1902bb15aef9c62259296fbc29Douglas Gregor float (*fp1)(float) = f0; 2000aeb52314ec0b1902bb15aef9c62259296fbc29Douglas Gregor} 21