annotate gcc/testsuite/g++.dg/cpp0x/pr62101.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // PR c++/62101
kono
parents:
diff changeset
2 // { dg-do compile { target c++11 } }
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 struct X
kono
parents:
diff changeset
5 {
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
6 friend void g(X, int) = 0; // { dg-error "15:initializer specified for friend function" }
111
kono
parents:
diff changeset
7 friend void g(X, int) = default; // { dg-error "cannot be defaulted" }
kono
parents:
diff changeset
8 // { dg-prune-output "note" }
kono
parents:
diff changeset
9 friend void f(X, int) = delete;
kono
parents:
diff changeset
10 friend void f(X, double) {}
kono
parents:
diff changeset
11 };
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 struct Y;
kono
parents:
diff changeset
14 void g(Y, int);
kono
parents:
diff changeset
15 void g(Y, double);
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 struct Y
kono
parents:
diff changeset
18 {
kono
parents:
diff changeset
19 // { dg-prune-output "note" }
kono
parents:
diff changeset
20 friend void g(Y, int) = delete;
kono
parents:
diff changeset
21 friend void g(Y, double) {}
kono
parents:
diff changeset
22 };
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 int main()
kono
parents:
diff changeset
25 {
kono
parents:
diff changeset
26 X x;
kono
parents:
diff changeset
27 f(x, 5.0);
kono
parents:
diff changeset
28 f(x, 5); // { dg-error "use of deleted function" }
kono
parents:
diff changeset
29 Y y;
kono
parents:
diff changeset
30 g(y, 5.0);
kono
parents:
diff changeset
31 g(y, 5); // { dg-error "use of deleted function" }
kono
parents:
diff changeset
32 }