[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / CXX / basic / basic.lookup / basic.lookup.unqual / p3.cpp
blob8ac4e9733ebb33ec719ff2a29aca86cda7f9c040
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
5 typedef int fn;
7 namespace N0 {
8 struct A {
9 friend void fn();
10 void g() {
11 int i = fn(1);
16 namespace N1 {
17 struct A {
18 friend void fn(A &);
19 operator int();
20 void g(A a) {
21 // ADL should not apply to the lookup of 'fn', it refers to the typedef
22 // above.
23 int i = fn(a);
28 namespace std_example {
29 int h; // expected-note {{non-template declaration}}
30 void g();
31 #if __cplusplus <= 201703L
32 // expected-note@-2 {{non-template declaration}}
33 #endif
34 namespace N {
35 struct A {};
36 template<class T> int f(T);
37 template<class T> int g(T);
38 #if __cplusplus <= 201703L
39 // expected-note@-2 {{here}}
40 #endif
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}}
47 #endif
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'?}}
51 #endif
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 {
56 struct A {};
57 void operator<(void (*fp)(), A);
58 void f() {}
59 int main() {
60 A a;
61 f < a;
62 #if __cplusplus > 201703L
63 // expected-error@-2 {{expected '>'}} expected-note@-2 {{to match this '<'}}
64 #endif
65 (f) < a;