view gcc/testsuite/g++.dg/cpp0x/constexpr-93169.C @ 19:2b5abeee2509 default tip

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
line wrap: on
line source

// 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;
}