Catch2 icon indicating copy to clipboard operation
Catch2 copied to clipboard

Using types with default template arguments TEMPLATE_PRODUCT_TEST_CASE_SIG fails compiling on clang

Open DNKpp opened this issue 3 years ago • 0 comments

Describe the bug I've compiled a minimal example. https://godbolt.org/z/MGnzaxEf7 There you can see, that the default argument of bad_testable let clang (and on my local machine clangCl too) fail to compile the code. When you remove bad_testable from the test case, it compiles fine.

Expected behavior Well, it should compile and behave as on gcc and msvc.

Reproduction steps

#include <type_traits>

#define CATCH_CONFIG_MAIN
#include <catch.hpp>
//#include <https://raw.githubusercontent.com/catchorg/Catch2/v2.x/single_include/catch2/catch.hpp>

template <bool V>
struct good_testable :  std::bool_constant<V>
{
};

template <bool V, class Dummy = void>
struct bad_testable :  std::bool_constant<V>
{
};

TEMPLATE_PRODUCT_TEST_CASE_SIG
(
	"test",
	"[test]",
	((bool V), V),
	(good_testable, bad_testable),
	(
		(true),
		(false)
	)
)
{
	REQUIRE(TestType::value);
}

Platform information:

  • OS: Windows and on what ever machine compiler-explorer runs
  • Compiler+version: clang and clangCl (all tested versions)
  • Catch version: catch2 (up2date)

Additional context Nothing to add.

DNKpp avatar Dec 27 '21 19:12 DNKpp