Debian Codegraph @

gcc/testsuite/g++.dg/inherit/multiple2.C

raw
1 // PR c++/88848
2 // { dg-do compile { target c++17 } }
3
4 template<typename>
5 struct True { static constexpr bool value{ true }; };
6
7 template<int VALUE>
8 struct Integer { static constexpr int value{ VALUE }; };
9
10 template<int VALUE, typename TYPE>
11 struct Foo
12 {
13 using Integer_t = Integer<VALUE>;
14
15 static TYPE get_type(Integer_t);
16 };
17
18 template<typename... ARGS>
19 struct Bar : ARGS...
20 {
21 using ARGS::get_type...;
22
23 template<int VALUE>
24 using Type_t = decltype(get_type(Integer<VALUE>{}));
25
26 Bar() { static_assert((True< Type_t<ARGS::Integer_t::value> >::value && ...)); }
27
28 static_assert((True< Type_t<ARGS::Integer_t::value> >::value && ...));
29 };
30
31 int main()
32 {
33 Bar<Foo<4, float>, Foo<8, double>> obj;
34 return int{ sizeof(obj) };
35 }