2 // { dg-do compile { target c++23 } }
4 // redeclarations of xobj member functions as static member functions and vice versa
7 // no additional params
8 void f_xs_v(this S) {}; // { dg-note {previous declaration} }
9 static void f_xs_v() {}; // { dg-error {cannot be overloaded with} }
11 void f_xs_ref(this S&) {}; // { dg-note {previous declaration} }
12 static void f_xs_ref() {}; // { dg-error {cannot be overloaded with} }
14 void f_xs_cref(this S const&) {}; // { dg-note {previous declaration} }
15 static void f_xs_cref() {}; // { dg-error {cannot be overloaded with} }
17 void f_xs_rref(this S&&) {}; // { dg-note {previous declaration} }
18 static void f_xs_rref() {}; // { dg-error {cannot be overloaded with} }
20 void f_xs_crref(this S const&&) {}; // { dg-note {previous declaration} }
21 static void f_xs_crref() {}; // { dg-error {cannot be overloaded with} }
24 static void f_sx_v() {}; // { dg-note {previous declaration} }
25 void f_sx_v(this S) {}; // { dg-error {cannot be overloaded with} }
27 static void f_sx_ref() {}; // { dg-note {previous declaration} }
28 void f_sx_ref(this S&) {}; // { dg-error {cannot be overloaded with} }
30 static void f_sx_cref() {}; // { dg-note {previous declaration} }
31 void f_sx_cref(this S const&) {}; // { dg-error {cannot be overloaded with} }
33 static void f_sx_rref() {}; // { dg-note {previous declaration} }
34 void f_sx_rref(this S&&) {}; // { dg-error {cannot be overloaded with} }
36 static void f_sx_crref() {}; // { dg-note {previous declaration} }
37 void f_sx_crref(this S const&&) {}; // { dg-error {cannot be overloaded with} }
39 // one additional param
40 void f_xs_v_int(this S, int) {}; // { dg-note {previous declaration} }
41 static void f_xs_v_int(int) {}; // { dg-error {cannot be overloaded with} }
43 void f_xs_ref_int(this S&, int) {}; // { dg-note {previous declaration} }
44 static void f_xs_ref_int(int) {}; // { dg-error {cannot be overloaded with} }
46 void f_xs_cref_int(this S const&, int) {}; // { dg-note {previous declaration} }
47 static void f_xs_cref_int(int) {}; // { dg-error {cannot be overloaded with} }
49 void f_xs_rref_int(this S&&, int) {}; // { dg-note {previous declaration} }
50 static void f_xs_rref_int(int) {}; // { dg-error {cannot be overloaded with} }
52 void f_xs_crref_int(this S const&&, int) {}; // { dg-note {previous declaration} }
53 static void f_xs_crref_int(int) {}; // { dg-error {cannot be overloaded with} }
56 static void f_sx_v_int(int) {}; // { dg-note {previous declaration} }
57 void f_sx_v_int(this S, int) {}; // { dg-error {cannot be overloaded with} }
59 static void f_sx_ref_int(int) {}; // { dg-note {previous declaration} }
60 void f_sx_ref_int(this S&, int) {}; // { dg-error {cannot be overloaded with} }
62 static void f_sx_cref_int(int) {}; // { dg-note {previous declaration} }
63 void f_sx_cref_int(this S const&, int) {}; // { dg-error {cannot be overloaded with} }
65 static void f_sx_rref_int(int) {}; // { dg-note {previous declaration} }
66 void f_sx_rref_int(this S&&, int) {}; // { dg-error {cannot be overloaded with} }
68 static void f_sx_crref_int(int) {}; // { dg-note {previous declaration} }
69 void f_sx_crref_int(this S const&&, int) {}; // { dg-error {cannot be overloaded with} }
71 // two additional params
72 void f_xs_v_int2(this S, int, int) {}; // { dg-note {previous declaration} }
73 static void f_xs_v_int2(int, int) {}; // { dg-error {cannot be overloaded with} }
75 void f_xs_ref_int2(this S&, int, int) {}; // { dg-note {previous declaration} }
76 static void f_xs_ref_int2(int, int) {}; // { dg-error {cannot be overloaded with} }
78 void f_xs_cref_int2(this S const&, int, int) {}; // { dg-note {previous declaration} }
79 static void f_xs_cref_int2(int, int) {}; // { dg-error {cannot be overloaded with} }
81 void f_xs_rref_int2(this S&&, int, int) {}; // { dg-note {previous declaration} }
82 static void f_xs_rref_int2(int, int) {}; // { dg-error {cannot be overloaded with} }
84 void f_xs_crref_int2(this S const&&, int, int) {}; // { dg-note {previous declaration} }
85 static void f_xs_crref_int2(int, int) {}; // { dg-error {cannot be overloaded with} }
88 static void f_sx_v_int2(int, int) {}; // { dg-note {previous declaration} }
89 void f_sx_v_int2(this S, int, int) {}; // { dg-error {cannot be overloaded with} }
91 static void f_sx_ref_int2(int, int) {}; // { dg-note {previous declaration} }
92 void f_sx_ref_int2(this S&, int, int) {}; // { dg-error {cannot be overloaded with} }
94 static void f_sx_cref_int2(int, int) {}; // { dg-note {previous declaration} }
95 void f_sx_cref_int2(this S const&, int, int) {}; // { dg-error {cannot be overloaded with} }
97 static void f_sx_rref_int2(int, int) {}; // { dg-note {previous declaration} }
98 void f_sx_rref_int2(this S&&, int, int) {}; // { dg-error {cannot be overloaded with} }
100 static void f_sx_crref_int2(int, int) {}; // { dg-note {previous declaration} }
101 void f_sx_crref_int2(this S const&&, int, int) {}; // { dg-error {cannot be overloaded with} }
104 // unrelated explicit object parameter type
110 // no additional params
111 void f_xs_v(this A) {}; // { dg-note {previous declaration} }
112 static void f_xs_v() {}; // { dg-error {cannot be overloaded with} }
114 void f_xs_ref(this A&) {}; // { dg-note {previous declaration} }
115 static void f_xs_ref() {}; // { dg-error {cannot be overloaded with} }
117 void f_xs_cref(this A const&) {}; // { dg-note {previous declaration} }
118 static void f_xs_cref() {}; // { dg-error {cannot be overloaded with} }
120 void f_xs_rref(this A&&) {}; // { dg-note {previous declaration} }
121 static void f_xs_rref() {}; // { dg-error {cannot be overloaded with} }
123 void f_xs_crref(this A const&&) {}; // { dg-note {previous declaration} }
124 static void f_xs_crref() {}; // { dg-error {cannot be overloaded with} }
127 static void f_sx_v() {}; // { dg-note {previous declaration} }
128 void f_sx_v(this A) {}; // { dg-error {cannot be overloaded with} }
130 static void f_sx_ref() {}; // { dg-note {previous declaration} }
131 void f_sx_ref(this A&) {}; // { dg-error {cannot be overloaded with} }
133 static void f_sx_cref() {}; // { dg-note {previous declaration} }
134 void f_sx_cref(this A const&) {}; // { dg-error {cannot be overloaded with} }
136 static void f_sx_rref() {}; // { dg-note {previous declaration} }
137 void f_sx_rref(this A&&) {}; // { dg-error {cannot be overloaded with} }
139 static void f_sx_crref() {}; // { dg-note {previous declaration} }
140 void f_sx_crref(this A const&&) {}; // { dg-error {cannot be overloaded with} }
142 // one additional param
143 void f_xs_v_int(this A, int) {}; // { dg-note {previous declaration} }
144 static void f_xs_v_int(int) {}; // { dg-error {cannot be overloaded with} }
146 void f_xs_ref_int(this A&, int) {}; // { dg-note {previous declaration} }
147 static void f_xs_ref_int(int) {}; // { dg-error {cannot be overloaded with} }
149 void f_xs_cref_int(this A const&, int) {}; // { dg-note {previous declaration} }
150 static void f_xs_cref_int(int) {}; // { dg-error {cannot be overloaded with} }
152 void f_xs_rref_int(this A&&, int) {}; // { dg-note {previous declaration} }
153 static void f_xs_rref_int(int) {}; // { dg-error {cannot be overloaded with} }
155 void f_xs_crref_int(this A const&&, int) {}; // { dg-note {previous declaration} }
156 static void f_xs_crref_int(int) {}; // { dg-error {cannot be overloaded with} }
159 static void f_sx_v_int(int) {}; // { dg-note {previous declaration} }
160 void f_sx_v_int(this A, int) {}; // { dg-error {cannot be overloaded with} }
162 static void f_sx_ref_int(int) {}; // { dg-note {previous declaration} }
163 void f_sx_ref_int(this A&, int) {}; // { dg-error {cannot be overloaded with} }
165 static void f_sx_cref_int(int) {}; // { dg-note {previous declaration} }
166 void f_sx_cref_int(this A const&, int) {}; // { dg-error {cannot be overloaded with} }
168 static void f_sx_rref_int(int) {}; // { dg-note {previous declaration} }
169 void f_sx_rref_int(this A&&, int) {}; // { dg-error {cannot be overloaded with} }
171 static void f_sx_crref_int(int) {}; // { dg-note {previous declaration} }
172 void f_sx_crref_int(this A const&&, int) {}; // { dg-error {cannot be overloaded with} }
174 // two additional params
175 void f_xs_v_int2(this A, int, int) {}; // { dg-note {previous declaration} }
176 static void f_xs_v_int2(int, int) {}; // { dg-error {cannot be overloaded with} }
178 void f_xs_ref_int2(this A&, int, int) {}; // { dg-note {previous declaration} }
179 static void f_xs_ref_int2(int, int) {}; // { dg-error {cannot be overloaded with} }
181 void f_xs_cref_int2(this A const&, int, int) {}; // { dg-note {previous declaration} }
182 static void f_xs_cref_int2(int, int) {}; // { dg-error {cannot be overloaded with} }
184 void f_xs_rref_int2(this A&&, int, int) {}; // { dg-note {previous declaration} }
185 static void f_xs_rref_int2(int, int) {}; // { dg-error {cannot be overloaded with} }
187 void f_xs_crref_int2(this A const&&, int, int) {}; // { dg-note {previous declaration} }
188 static void f_xs_crref_int2(int, int) {}; // { dg-error {cannot be overloaded with} }
191 static void f_sx_v_int2(int, int) {}; // { dg-note {previous declaration} }
192 void f_sx_v_int2(this A, int, int) {}; // { dg-error {cannot be overloaded with} }
194 static void f_sx_ref_int2(int, int) {}; // { dg-note {previous declaration} }
195 void f_sx_ref_int2(this A&, int, int) {}; // { dg-error {cannot be overloaded with} }
197 static void f_sx_cref_int2(int, int) {}; // { dg-note {previous declaration} }
198 void f_sx_cref_int2(this A const&, int, int) {}; // { dg-error {cannot be overloaded with} }
200 static void f_sx_rref_int2(int, int) {}; // { dg-note {previous declaration} }
201 void f_sx_rref_int2(this A&&, int, int) {}; // { dg-error {cannot be overloaded with} }
203 static void f_sx_crref_int2(int, int) {}; // { dg-note {previous declaration} }
204 void f_sx_crref_int2(this A const&&, int, int) {}; // { dg-error {cannot be overloaded with} }