20 lines · plain
1// RUN: %clang_cc1 -std=c++20 %s -fsyntax-only -verify2export module m;3 4namespace test {5namespace ns1 {6 namespace ns2 {7 template<class T> void f(T t); // expected-note {{target of using declaration}}8 }9 using ns2::f; // expected-note {{using declaration}}10}11struct A { void f(); }; // expected-note 2{{target of using declaration}}12struct B : public A { using A::f; }; // expected-note {{using declaration}}13template<typename T> struct C : A { using A::f; }; // expected-note {{using declaration}}14struct X {15 template<class T> friend void ns1::f(T t); // expected-error {{cannot befriend target of using declaration}}16 friend void B::f(); // expected-error {{cannot befriend target of using declaration}}17 friend void C<int>::f(); // expected-error {{cannot befriend target of using declaration}}18};19}20