Merge from trunk
[official-gcc.git] / gcc / testsuite / g++.dg / ipa / pr51929.C
blobcfc3df212a1dd9c9eee5265c756b243f2d129447
1 // PR middle-end/51929
2 // { dg-do compile }
3 // { dg-options "-O -fno-guess-branch-probability -fipa-cp -fipa-cp-clone --param=max-inline-insns-single=25" }
5 struct A
7   A (A, unsigned);
8   A (const char *);
9   ~A () { a1 (a4 ()); }
10   void a1 (int);
11   unsigned a2 ();
12   char *a3 ();
13   int a4 ();
16 template <typename T>
17 struct B
19   A b;
20   B (A x, int y = 1) : b (x.a3 (), x.a2 ()) { if (y & 1) b.a2 (); }
23 extern template struct B <char>;
24 A a1 ("foo"), a2 ("bar");
25 B<char> b1 (a1), b2 (a2, 8);
27 void
28 foo ()
30   A a3 ("baz");
31   B<char> b3 (a1), b4 (a3);