summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/constexpr-volatile.C
blob: 1203b04aff5aa1f0f6e7312568272bbeec318ea6 (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
// DR 1453
// { dg-do compile { target c++11 } }

struct S {
  constexpr S() : n{} { }
  volatile int n;
};

constexpr S s;  // { dg-error "literal" }

struct Z {
  volatile int m;
};

struct T {
  constexpr T() : n{} { }
  Z n;
};

constexpr T t;  // { dg-error "literal" }

struct U : Z {
  constexpr U() : Z{} { }
};

constexpr U u;  // { dg-error "literal" }