Debian Codegraph @

gcc/testsuite/g++.dg/cpp1y/nsdmi-aggr13.C

raw
1 // PR c++/96673
2 // { dg-do compile { target c++11 } }
3
4 template <class T>
5 class A {};
6
7 template <class T>
8 class B;
9
10 template <class T>
11 class C {
12 private:
13
14 friend class B<T>;
15
16 explicit C(A<T>&) {};
17 };
18
19
20 template <class T>
21 class B {
22 public:
23 B() = default;
24 //B() {}; // << This implementation of the constructor makes it work
25
26 A<T> a = {};
27 C<T> c = C<T>{a};
28 };
29
30 int main() {
31 auto b = B<int>{};
32 auto &c = b.c;
33 }