Allow using only types in TEMPLATE_TEST_CASE_SIG. (#2995)

Right now `TEMPLATE_TEST_CASE_SIG` fails to compile when the signature contains only types:

```
TEMPLATE_TEST_CASE_SIG(
  "TemplateTestSig: compiles with two type parameters",
  "[template][onlytypes]",
  ((typename U, typename V), U, V), (int,int)) {}
```

The trick is to resolve the ambiguity between the two overloads of
`get_wrapper` (`TypeList` and `Nttp`) by making one match more strongly.
We also need to allow `reg_test` to register more than one type.

Add unit tests.

Fixes #2680

---------

Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
This commit is contained in:
Clement Courbet
2025-07-08 14:26:25 +02:00
committed by GitHub
parent 8dc9f1a124
commit 2de12cb05f
20 changed files with 182 additions and 32 deletions

View File

@@ -1893,6 +1893,10 @@ at Misc.tests.cpp:<line number>
<testCase name="TemplateTest: vectors can be sized and resized - std::tuple&lt;int,float>/resizing smaller changes size but not capacity/We can use the 'swap trick' to reset the capacity" duration="{duration}"/>
<testCase name="TemplateTest: vectors can be sized and resized - std::tuple&lt;int,float>/reserving bigger changes capacity but not size" duration="{duration}"/>
<testCase name="TemplateTest: vectors can be sized and resized - std::tuple&lt;int,float>/reserving smaller does not change size or capacity" duration="{duration}"/>
<testCase name="TemplateTestSig: compiles with a single int parameter - 1" duration="{duration}"/>
<testCase name="TemplateTestSig: compiles with a single int parameter - 3" duration="{duration}"/>
<testCase name="TemplateTestSig: compiles with a single int parameter - 6" duration="{duration}"/>
<testCase name="TemplateTestSig: compiles with two type parameters - int,int" duration="{duration}"/>
<testCase name="TemplateTestSig: vectors can be sized and resized - (std::tuple&lt;int, float>), 6" duration="{duration}"/>
<testCase name="TemplateTestSig: vectors can be sized and resized - (std::tuple&lt;int, float>), 6/resizing bigger changes size and capacity" duration="{duration}"/>
<testCase name="TemplateTestSig: vectors can be sized and resized - (std::tuple&lt;int, float>), 6/resizing smaller changes size but not capacity" duration="{duration}"/>