1 // PR c++/62101
2 // { dg-do compile { target c++11 } }
3
4 struct X
5 {
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;
fX10 friend void f(X, double) {}
11 };
12
13 struct Y;
14 void g(Y, int);
15 void g(Y, double);
16
17 struct Y
18 {
19 // { dg-prune-output "note" }
20 friend void g(Y, int) = delete; // { dg-error "not first declaration" }
gY21 friend void g(Y, double) {}
22 };
23
main()24 int main()
25 {
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" }
32 }
33