Unable to use TEMPLATE_TEST_CASE_SIG with variadic template arguments
Describe the bug
I've been trying to use TEMPLATE_TEST_CASE_SIG with variadic template parameters, just as mentioned in the documentation, but I've never been able to make it work. Suppose the following code:
template <class T, class... Args>
class Foo
{
public:
bool Make(Args&&... args)
{
return true;
}
};
TEMPLATE_TEST_CASE_SIG("test", "[test]", ((typename T, typename...Ts), T, Ts...), int, (int, true))
{
auto foo = Foo<T>();
REQUIRE(foo.Make(Ts...));
}
Compiler output the following error:
2>D:\Tests.cpp(98,1): error C2668: '`anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____16::get_wrapper': ambiguous call to overloaded function
2>D:\Tests.cpp(98,1): message : could be '`anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____16::Nttp<int> `anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____16::get_wrapper<int,>(void) noexcept'
2>D:\Tests.cpp(98,1): message : or '`anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____16::TypeList<int> `anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____16::get_wrapper<int>(void) noexcept'
2>D:\Tests.cpp(98,1): message : while trying to match the argument list '()'
2>D:\Tests.cpp(98,1): error C2672: 'get_wrapper': no matching overloaded function found
2>D:\Tests.cpp(98,1): error C2974: '`anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____16::get_wrapper': invalid template argument for 'Cs', type expected
2>D:\Tests.cpp(98): message : see declaration of '`anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____16::get_wrapper'
2>D:\Tests.cpp(98,1): error C2974: '`anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____16::get_wrapper': invalid template argument for 'Ts', type expected
2>D:\Tests.cpp(98): message : see declaration of '`anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____16::get_wrapper'
Expected behavior
Once the compile issue resolved, expecting the test case to be called with T = int then again with T = int, Ts = true.
Reproduction steps
Try compiling the code snippet above.
Platform information:
- OS: Windows 10 x64
- Compiler+version: MSVC 16.11.2 (Visual Studio 2019)
- Catch version: v2.13.7
Additional context
Am I understanding correctly what TEMPLATE_TEST_CASE_SIG with variadic template parameters is able to do? Also tried to call the macro this way:
TEMPLATE_TEST_CASE_SIG("test", "[test]", ((typename T, typename...Ts), T, Ts...), (int, false), (int, true))
...but it results in the same error.
I'm also getting this issue, but in my case I'm not even using variadic template parameters.
Simple example: https://godbolt.org/z/6nEsnfedh