Fix non-default-constructible type lists used in TEMPLATE_LIST_TEST_CASE (#1697)

* Fix non-default-constructible type lists used in TEMPLATE_LIST_TEST_CASE

std::tuple is not default constructible when the first type is not
default-constuctible. Therefore it can not be instantiated.
to circumvent this, we have to use std::declval in the unevaluate decltype
context.
This commit is contained in:
Benjamin Worpitz
2019-07-22 12:56:33 +02:00
committed by Martin Hořeňovský
parent a22b7df46c
commit e7c26f09d1
7 changed files with 94 additions and 9 deletions

View File

@@ -247,7 +247,7 @@ struct AutoReg : NonCopyable {
} \
};\
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \
using TestInit = decltype(convert<TestName>(TmplList {})); \
using TestInit = decltype(convert<TestName>(std::declval<TmplList>())); \
TestInit t; \
t.reg_tests(); \
return 0; \
@@ -374,7 +374,7 @@ struct AutoReg : NonCopyable {
}\
};\
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
using TestInit = decltype(convert<TestNameClass>(TmplList {}));\
using TestInit = decltype(convert<TestNameClass>(std::declval<TmplList>()));\
TestInit t;\
t.reg_tests();\
return 0;\