c++: add fixed test [PR91079]
Fixed by r12-2975. PR c++/91079 DR 1881 gcc/testsuite/ChangeLog: * g++.dg/ext/is_std_layout5.C: New test.
This commit is contained in:
parent
e7d015b250
commit
2b2d3a135a
1 changed files with 13 additions and 0 deletions
13
gcc/testsuite/g++.dg/ext/is_std_layout5.C
Normal file
13
gcc/testsuite/g++.dg/ext/is_std_layout5.C
Normal file
|
@ -0,0 +1,13 @@
|
|||
// PR c++/91079
|
||||
// DR 1881 - Standard-layout classes and unnamed bit-fields
|
||||
// { dg-do compile { target c++11 } }
|
||||
|
||||
struct A { int a : 4; };
|
||||
struct B : A { int b : 3; };
|
||||
static_assert(__is_standard_layout(A), "");
|
||||
static_assert(!__is_standard_layout(B), "");
|
||||
|
||||
struct C { int : 0; };
|
||||
struct D : C { int : 0; };
|
||||
static_assert(__is_standard_layout(C), "");
|
||||
static_assert(!__is_standard_layout(D), "");
|
Loading…
Add table
Reference in a new issue