@@ -313,24 +313,26 @@ template <typename...Ts> struct index_by;
313
313
template <typename T, typename Indices>
314
314
concept InitFunc = true ;
315
315
316
- namespace Invalid {
316
+ namespace ExpandsBoth {
317
317
318
318
template <typename Indices, InitFunc<Indices> auto ... init>
319
- struct LazyLitMatrix ;
319
+ struct LazyLitMatrix ; // expected-note {{here}}
320
320
321
321
template <
322
322
typename ...Indices,
323
323
InitFunc<index_by<Indices>> auto ... init
324
- // expected-error@-1 {{type constraint contains unexpanded parameter pack 'Indices'}}
325
324
>
326
325
struct LazyLitMatrix <index_by<Indices...>, init...> {
327
326
};
328
327
329
- using T = LazyLitMatrix<index_by<int , char >, 42 , 43 >;
328
+ // FIXME: Explain why we didn't pick up the partial specialization - pack sizes don't match.
329
+ template struct LazyLitMatrix <index_by<int , char >, 42 >;
330
+ // expected-error@-1 {{instantiation of undefined template}}
331
+ template struct LazyLitMatrix <index_by<int , char >, 42 , 43 >;
330
332
331
333
}
332
334
333
- namespace Valid {
335
+ namespace ExpandsRespectively {
334
336
335
337
template <typename Indices, InitFunc<Indices> auto ... init>
336
338
struct LazyLitMatrix ;
@@ -342,7 +344,42 @@ template <
342
344
struct LazyLitMatrix <index_by<Indices...>, init...> {
343
345
};
344
346
345
- using T = LazyLitMatrix<index_by<int , char >, 42 , 43 >;
347
+ template struct LazyLitMatrix <index_by<int , char >, 42 >;
348
+ template struct LazyLitMatrix <index_by<int , char >, 42 , 43 >;
349
+
350
+ }
351
+
352
+ namespace TypeParameter {
353
+
354
+ template <typename Indices, InitFunc<Indices>... init>
355
+ struct LazyLitMatrix ; // expected-note {{here}}
356
+
357
+ template <
358
+ typename ...Indices,
359
+ InitFunc<index_by<Indices>>... init
360
+ >
361
+ struct LazyLitMatrix <index_by<Indices...>, init...> {
362
+ };
363
+
364
+ // FIXME: Explain why we didn't pick up the partial specialization - pack sizes don't match.
365
+ template struct LazyLitMatrix <index_by<int , char >, float >;
366
+ // expected-error@-1 {{instantiation of undefined template}}
367
+ template struct LazyLitMatrix <index_by<int , char >, unsigned , float >;
368
+
369
+ }
370
+
371
+ namespace Invalid {
372
+
373
+ template <typename Indices, InitFunc<Indices>... init>
374
+ struct LazyLitMatrix ;
375
+
376
+ template <
377
+ typename ...Indices,
378
+ InitFunc<index_by<Indices>> init
379
+ // expected-error@-1 {{unexpanded parameter pack 'Indices'}}
380
+ >
381
+ struct LazyLitMatrix <index_by<Indices...>, init> {
382
+ };
346
383
347
384
}
348
385
0 commit comments