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