[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / g++.dg / debug / pr47283.C
blobdadbeff3deb278879324de079947b66b08dc4e47
1 // PR debug/47283
2 // { dg-do compile }
4 template <typename T> inline const T &
5 f1 (const T &a, const T &b)
7   if (a < b)
8     return b;
9   return a;
12 struct A
14   A (int w, int h) { a1 = w; }
15   A f2 (const A &) const;
16   int a1, a2;
19 inline A
20 A::f2 (const A &x) const
22   return A (f1 (a1, x.a1), f1 (a2, x.a2));
25 struct B
27   A f3 () const;
28   void f4 (const A &) { b2 = 5 + b1; }
29   int b1, b2;
32 struct C
36 struct D
38   virtual C f5 (const C &) const;
41 struct E
43   C f6 () const;
44   int f7 () const;
45   virtual B f8 (const C &) const;
46   A f9 () const;
47   virtual void f10 ();
48   struct F { D *h; } *d;
51 void
52 E::f10 ()
54   const C c = d->h->f5 (f6 ());
55   B b = f8 (c);
56   b.f4 (b.f3 ().f2 (f9 ()));
57   f7 ();