You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
structB; // expected-note {{template is declared here}}
194
+
195
+
template<typename U, bool V> requires V
196
+
structB<U*, V>; // expected-note {{template is declared here}}
197
+
// expected-note@-1 {{partial specialization matches [with U = int, V = true]}}
198
+
};
199
+
200
+
template<>
201
+
template<typename U, bool V> requires V
202
+
constexprint A<short>::f() {
203
+
return A<long>::f<U, V>();
204
+
}
205
+
206
+
template<>
207
+
template<typename U, bool V> requires V
208
+
constexprint A<short>::x = A<long>::x<U, V>;
209
+
210
+
template<>
211
+
template<typename U, bool V> requires V
212
+
constexprint A<short>::x<U*, V> = A<long>::x<U*, V>; // expected-error {{constexpr variable 'x<int *, true>' must be initialized by a constant expression}}
213
+
// expected-note@-1 {{initializer of 'x<int *, true>' is unknown}}
214
+
// expected-note@-2 {{declared here}}
215
+
216
+
template<>
217
+
template<typename U, bool V> requires V
218
+
structA<short>::B<U*, V> { // expected-note {{partial specialization matches [with U = int, V = true]}}
219
+
staticconstexprint y = A<long>::B<U*, V>::y;
220
+
};
221
+
222
+
template<>
223
+
template<typename U, bool V> requires V
224
+
structA<short>::B {
225
+
staticconstexprint y = A<long>::B<U, V>::y;
226
+
};
227
+
228
+
template<>
229
+
template<typename U, bool V> requires V
230
+
constexprint A<long>::f() {
231
+
return1;
232
+
}
233
+
234
+
template<>
235
+
template<typename U, bool V> requires V
236
+
constexprint A<long>::x = 1;
237
+
238
+
template<>
239
+
template<typename U, bool V> requires V
240
+
constexprint A<long>::x<U*, V> = 2;
241
+
242
+
template<>
243
+
template<typename U, bool V> requires V
244
+
structA<long>::B {
245
+
staticconstexprint y = 1;
246
+
};
247
+
248
+
template<>
249
+
template<typename U, bool V> requires V
250
+
structA<long>::B<U*, V> {
251
+
staticconstexprint y = 2;
252
+
};
253
+
254
+
static_assert(A<int>::f<int, true>() == 0); // expected-error {{static assertion expression is not an integral constant expression}}
255
+
// expected-note@-1 {{undefined function 'f<int, true>' cannot be used in a constant expression}}
256
+
static_assert(A<int>::x<int, true> == 0); // expected-error {{static assertion expression is not an integral constant expression}}
257
+
// expected-note@-1 {{initializer of 'x<int, true>' is unknown}}
258
+
static_assert(A<int>::x<int*, true> == 0); // expected-error {{static assertion expression is not an integral constant expression}}
259
+
// expected-note@-1 {{initializer of 'x<int *, true>' is unknown}}
0 commit comments