131
|
1 // PR c++/86378
|
|
2 // { dg-do compile { target c++11 } }
|
|
3
|
|
4 struct Pepper {};
|
|
5 struct Apple { Apple(int) {} };
|
|
6
|
|
7 struct Combination : Apple, Pepper
|
|
8 {
|
|
9 Combination(Pepper p, Apple a)
|
|
10 : Apple(a), Pepper(p)
|
|
11 {}
|
|
12 };
|
|
13
|
|
14 struct MyCombination
|
|
15 {
|
|
16 using Spice = Pepper;
|
|
17 using Fruit = Apple;
|
|
18
|
|
19 Combination combination;
|
|
20
|
|
21 template<typename T>
|
|
22 constexpr MyCombination(T&& t)
|
|
23 noexcept(noexcept(Combination(Spice(), Fruit(t))))
|
|
24 : combination(Spice(), Fruit(t))
|
|
25 {}
|
|
26 };
|
|
27
|
|
28 MyCombination obj(Apple(4));
|