Debian Codegraph @

gcc/testsuite/g++.dg/parse/bitfield2.C

raw
1 //PR c++/28053
2
3 struct X {};
4
5 struct A
6 {
7 X x : 2; // { dg-error "7:bit-field .x. with non-integral type .X." }
8 };
9 struct B : A {};
10
11 template <typename T>
12 struct C
13 {
14 T t : 3;
15 };
16
17 C<int> c;
18
19 template <typename T>
20 struct D
21 {
22 T t : 3; // { dg-error "5:bit-field .double D\\<double\\>::t. with non-integral type .double." }
23 };
24
25 D<double> d; // { dg-message "required" }
26
27 template <typename T>
28 struct E
29 {
30 typedef T* U;
31 U t : 3; // { dg-error "5:bit-field .t. with non-integral type .E\\<T\\>::U." }
32 };
33
34 E<double> e;