Open
Description
#include <type_traits>
template <typename Integer, Integer C, unsigned I, template <typename, Integer, unsigned> class Trait, typename = void>
class Foo : public std::integral_constant<bool, true> {};
template <typename Integer, Integer C, unsigned I>
class Bar : public std::integral_constant<bool, Foo<Integer, C, I, Bar>::value> {};
template <typename Integer, Integer C>
class Bar<Integer, C, 0> : public std::false_type {};
template <typename Integer, unsigned I>
class Baz : public std::integral_constant<bool, Bar<Integer, 1, I>::value> {};
Baz<long, 20> x;
This ostensibly valid code compiles fine on gcc, msvc, and clang 19 but fails on clang 20 with the following error:
<source>:6:20: error: conflicting deduction 'type-parameter-0-0' against 'long' for parameter
6 | template <typename Integer, Integer C, unsigned I>
| ^
<source>:7:68: note: template template argument has different template parameters than its corresponding template template parameter
7 | class Bar : public std::integral_constant<bool, Foo<Integer, C, I, Bar>::value> {};
| ^
<source>:3:97: note: previous template template parameter is here
3 | template <typename Integer, Integer C, unsigned I, template <typename, Integer, unsigned> class Trait, typename = void>
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
<source>:13:49: note: in instantiation of template class 'Bar<long, 1, 20>' requested here
13 | class Baz : public std::integral_constant<bool, Bar<Integer, 1, I>::value> {};
| ^
<source>:15:15: note: in instantiation of template class 'Baz<long, 20>' requested here
15 | Baz<long, 20> x;
| ^