aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/opt/pr59947.C
blob: 71c51b226cea5f7f73b10fa128d90abfd346374b (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 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>;