Debian Codegraph @

gcc/testsuite/g++.dg/cpp1z/using-variadic1b.C

raw
1 // PR c++/102104
2 // A version of using-variadic1.C where only the qualifying scope
3 // uses a parameter pack.
4 // { dg-do compile { target c++17 } }
5
6 struct A {
7 using target_type = bool*;
8 };
9
10 struct B {
11 using target_type = long*;
12 };
13
14 struct C {
15 operator bool*();
16 operator long*();
17 };
18
19 template<typename Base>
20 struct cls {
21 template<class... Ts>
22 struct nested : private Base {
23 using Base::operator typename Ts::target_type...;
24 };
25 };
26
27 cls<C>::nested<A, B> v1;
28 bool* a1 = v1;
29 long* b1 = v1;
30
31 cls<C>::nested<B> v2;
32 bool* a2 = v2; // { dg-error "inaccessible|not an accessible" }
33 long* b2 = v2;
34
35 cls<C>::nested<A> v3;
36 bool* a3 = v3;
37 long* b3 = v3; // { dg-error "inaccessible|not an accessible" }