Debian Codegraph @

gcc/testsuite/g++.dg/cpp2a/nontype-subob2.C

raw
1 // { dg-do compile { target c++20 } }
2 // { dg-additional-options -Wno-inaccessible-base }
3
4 struct Base { int i; };
5 template <int N> struct Derived : Derived<N-1>, Base {};
6 template <> struct Derived<0> : Base {};
7
8 template <int* P> struct A { };
9
10 Derived<4> d;
11 void f(A<&((Derived<0>&)d).i>) {}
12
13 // { dg-final { scan-assembler _Z1f1AIXaddtcvR7DerivedILi0EEL_Z1dE1iEE } }