view gcc/testsuite/g++.dg/opt/pr59947.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

// PR ipa/59947
// { dg-do compile { target c++11 } }
// { dg-options "-O0" }

#pragma GCC optimize ("O2")
template <typename T>
inline void
foo (T & a) noexcept { T tmp = static_cast <T &&> (a); };
struct A
{
  A () noexcept : a (1), b (1) {}
  virtual void c () noexcept = 0;
  void d () noexcept { c (); }
  int a;
  int b;
};
struct B
{
  ~B () noexcept { e->d (); }
  A *e;
};
template <typename T>
struct C
{
  B f;
};
struct D {};
template <typename T>
struct E
{
  void bar () { foo (g); }
  C <D> g;
};
template class E <char>;