Debian Codegraph @

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

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