summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/constexpr-93169.C
blob: 79fd352c0c565dd682c7610fa85383cce859c8b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// PR c++/93169 - Wrong-code with a non-constexpr constructor.
// { dg-do run { target c++11 } }
// { dg-options "-O2" }

template <typename T> class B {
  struct C {
    T h;
    constexpr C() {}
    ~C() {}
  } c;
};
struct S {
  int g;
  S() { g = 2; }
};

int
main()
{
  static const B<S> f;
}