[Flang] remove whole-archive option for AIX linker (#76039)
[llvm-project.git] / clang / test / CXX / class.access / class.friend / p6.cpp
blob47104e29dc6b3c7554bf750840d5a8da47ad533b
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 void f1();
5 struct X {
6 void f2();
7 };
9 struct Y {
10 friend void ::f1() { } // expected-error{{friend function definition cannot be qualified with '::'}}
11 friend void X::f2() { } // expected-error{{friend function definition cannot be qualified with 'X::'}}
14 template <typename T> struct Z {
15 friend void T::f() {} // expected-error{{friend function definition cannot be qualified with 'T::'}}
18 void local() {
19 void f();
21 struct Local {
22 friend void f() { } // expected-error{{friend function cannot be defined in a local class}}
26 template<typename T> void f3(T);
28 namespace N {
29 template<typename T> void f4(T);
32 template<typename T> struct A {
33 friend void f3(T) {}
34 friend void f3<T>(T) {} // expected-error{{friend function specialization cannot be defined}}
35 friend void N::f4(T) {} // expected-error{{friend function definition cannot be qualified with 'N::'}}
36 friend void N::f4<T>(T) {} // expected-error{{friend function definition cannot be qualified with 'N::'}}