[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / CXX / class.access / class.friend / p11.cpp
blob71f11bdf9e073676bf80badfce3c8bc54ff74f0f
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 namespace test0 {
4 void foo() {
5 void bar();
6 class A {
7 friend void bar();
8 };
12 namespace test1 {
13 void foo() {
14 class A {
15 friend void bar(); // expected-error {{no matching function found in local scope}}
20 namespace test2 {
21 void bar(); // expected-note 3{{'::test2::bar' declared here}}
23 void foo() { // expected-note 2{{'::test2::foo' declared here}}
24 struct S1 {
25 friend void foo(); // expected-error {{no matching function 'foo' found in local scope; did you mean '::test2::foo'?}}
28 void foo(); // expected-note {{local declaration nearly matches}}
29 struct S2 {
30 friend void foo();
34 struct S2 {
35 friend void foo(); // expected-error {{no matching function found in local scope}}
40 int foo;
41 struct S3 {
42 friend void foo(); // expected-error {{no matching function 'foo' found in local scope; did you mean '::test2::foo'?}}
46 struct S4 {
47 friend void bar(); // expected-error {{no matching function 'bar' found in local scope; did you mean '::test2::bar'?}}
50 { void bar(); }
51 struct S5 {
52 friend void bar(); // expected-error {{no matching function 'bar' found in local scope; did you mean '::test2::bar'?}}
56 void bar();
57 struct S6 {
58 friend void bar();
62 struct S7 {
63 void bar() { Inner::f(); }
64 struct Inner {
65 friend void bar();
66 static void f() {}
70 void bar(); // expected-note {{'bar' declared here}}
71 struct S8 {
72 struct Inner {
73 friend void bar();
77 struct S9 {
78 struct Inner {
79 friend void baz(); // expected-error {{no matching function 'baz' found in local scope; did you mean 'bar'?}}
83 struct S10 {
84 void quux() {}
85 void foo() {
86 struct Inner1 {
87 friend void bar(); // expected-error {{no matching function 'bar' found in local scope; did you mean '::test2::bar'?}}
88 friend void quux(); // expected-error {{no matching function found in local scope}}
91 void bar();
92 struct Inner2 {
93 friend void bar();