[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.jason / scoping15.C
blobc677b0d36d3eec6eab4d727847fdb1543250c393
1 // { dg-do assemble  }
2 // { dg-options "-ffriend-injection" }
3 // Bug: g++ ignores the :: qualification and dies trying to treat an integer
4 // variable as a list of functions.
6 class DComplex;
7 double imag (const DComplex&);
9 class DComplex {
10 public:
11   friend  double   imag(const DComplex& a); // Not injected, no warning
14 class FComplex {
15 public:
16   friend  float    imag(const FComplex& a); // { dg-warning "is visible" }
19 void
20 scnrm2(FComplex cx[])
22   int imag;
23   ::imag( cx[0] );
25 // { dg-warning "ffriend-injection.* is deprecated" "cc1plus:" { target *-*-* } 0 }