Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/cpp0x/noexcept33.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
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)); |