Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / pr62101.C
blob07ab1b76fbc02499d55b7831a2e5421c52aa63a6
1 // PR c++/62101
2 // { dg-do compile { target c++11 } }
4 struct X
6   friend void g(X, int) = 0; // { dg-error "15:initializer specified for friend function" }
7   friend void g(X, int) = default; // { dg-error "cannot be defaulted" }
8   // { dg-prune-output "note" }
9   friend void f(X, int) = delete;
10   friend void f(X, double) {}
13 struct Y;
14 void g(Y, int);
15 void g(Y, double);
17 struct Y
19   // { dg-prune-output "note" }
20   friend void g(Y, int) = delete; // { dg-error "not first declaration" }
21   friend void g(Y, double) {}
24 int main()
26   X x;
27   f(x, 5.0);
28   f(x, 5); // { dg-error "use of deleted function" }
29   Y y;
30   g(y, 5.0);
31   g(y, 5); // { dg-error "use of deleted function" }