aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/parse/bitfield2.C
blob: f84cc673e57475e66fcafe77040c47c251f0512b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//PR c++/28053

struct X {};

struct A
{
    X x : 2;            // { dg-error "non-integral type" }
};
struct B : A {};

template <typename T>
struct C
{
  T t : 3;
};

C<int> c;

template <typename T>
struct D
{
  T t : 3;              // { dg-error "non-integral type" }
};

D<double> d;            // { dg-message "required" }

template <typename T>
struct E
{
  typedef T* U;
  U t : 3;             // { dg-error "non-integral type" }
};

E<double> e;