// RUN: %clang_cc1 -fsyntax-only -verify %s
// RUN: %clang_cc1 -std=c++17 -fsyntax-only -verify %s
// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s
typedefintfn;namespaceN0{structA{friendvoid fn();voidg(){int i =fn(1);}};}namespaceN1{structA{friendvoid fn(A &);operatorint();voidg(A a){// ADL should not apply to the lookup of 'fn', it refers to the typedef
// above.
int i =fn(a);}};}namespacestd_example{int h;// expected-note {{non-template declaration}}
voidg();#if __cplusplus <= 201703L
// expected-note@-2 {{non-template declaration}}
#endifnamespaceN{structA{};template<class T>intf(T);template<class T>intg(T);#if __cplusplus <= 201703L
// expected-note@-2 {{here}}
#endiftemplate<class T>inth(T);// expected-note {{here}}
}int x = f<N::A>(N::A());#if __cplusplus <= 201703L
// expected-warning@-2 {{C++20 extension}}
#endifint y = g<N::A>(N::A());#if __cplusplus <= 201703L
// expected-error@-2 {{'g' does not name a template but is followed by template arguments; did you mean 'N::g'?}}
#endifint z = h<N::A>(N::A());// expected-error {{'h' does not name a template but is followed by template arguments; did you mean 'N::h'?}}
}namespaceAnnexD_example{structA{};voidoperator<(void(*fp)(),A);voidf(){}intmain(){
A a;
f < a;#if __cplusplus > 201703L
// expected-error@-2 {{expected '>'}} expected-note@-2 {{to match this '<'}}
#endif(f)< a;}}