aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Modules/befriend-3.cppm
blob: f8dbc423be2ca185e2c5b1b60c13c3c92648521c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// RUN: %clang_cc1 -std=c++20 %s -fsyntax-only -verify
export module m;

namespace test {
namespace ns1 {
    namespace ns2 {
    template<class T> void f(T t); // expected-note {{target of using declaration}}
    }
    using ns2::f; // expected-note {{using declaration}}
}
struct A { void f(); }; // expected-note 2{{target of using declaration}}
struct B : public A { using A::f; }; // expected-note {{using declaration}}
template<typename T> struct C : A { using A::f; }; // expected-note {{using declaration}}
struct X {
    template<class T> friend void ns1::f(T t); // expected-error {{cannot befriend target of using declaration}}
    friend void B::f(); // expected-error {{cannot befriend target of using declaration}}
    friend void C<int>::f(); // expected-error {{cannot befriend target of using declaration}}
};
}