1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -std=c++17 -fsyntax-only -verify %s
3 // RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s
21 // ADL should not apply to the lookup of 'fn', it refers to the typedef
28 namespace std_example
{
29 int h
; // expected-note {{non-template declaration}}
31 #if __cplusplus <= 201703L
32 // expected-note@-2 {{non-template declaration}}
36 template<class T
> int f(T
);
37 template<class T
> int g(T
);
38 #if __cplusplus <= 201703L
39 // expected-note@-2 {{here}}
41 template<class T
> int h(T
); // expected-note {{here}}
44 int x
= f
<N::A
>(N::A());
45 #if __cplusplus <= 201703L
46 // expected-warning@-2 {{C++20 extension}}
48 int y
= g
<N::A
>(N::A());
49 #if __cplusplus <= 201703L
50 // expected-error@-2 {{'g' does not name a template but is followed by template arguments; did you mean 'N::g'?}}
52 int 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'?}}
55 namespace AnnexD_example
{
57 void operator<(void (*fp
)(), A
);
62 #if __cplusplus > 201703L
63 // expected-error@-2 {{expected '>'}} expected-note@-2 {{to match this '<'}}