| 1 |
// RUN: %clang_cc1 -std=c++20 %s -fsyntax-only -verify |
| 2 |
export module m; |
| 3 |
|
| 4 |
namespace test { |
| 5 |
namespace 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 |
} |
| 11 |
struct A { void f(); }; // expected-note 2{{target of using declaration}} |
| 12 |
struct B : public A { using A::f; }; // expected-note {{using declaration}} |
| 13 |
template<typename T> struct C : A { using A::f; }; // expected-note {{using declaration}} |
| 14 |
struct 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 |
} |