| 1 |
// PR c++/58074 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
|
| 4 |
struct Trivial |
| 5 |
{ |
| 6 |
Trivial() = delete; |
| 7 |
}; |
| 8 |
|
| 9 |
struct NonTrivial |
| 10 |
{ |
| 11 |
NonTrivial() = default; |
| 12 |
NonTrivial(NonTrivial&) = default; |
| 13 |
NonTrivial& operator=(NonTrivial&) = default; |
| 14 |
}; |
| 15 |
|
| 16 |
// As it happens, 58074 was originally asking for the opposite result |
| 17 |
// of __is_trivial than we're checking here, so what was non-trivial |
| 18 |
// was supposed to be trivial and vice versa. But here we are. |
| 19 |
static_assert(!__is_trivial(Trivial), "Ouch"); |
| 20 |
static_assert(__is_trivial(NonTrivial), "Ouch"); |