Issue 138078
Summary Clang 20 regression: conflicting deduction 'type-parameter-0-0' against 'long' for parameter
Labels clang
Assignees
Reporter jeremy-rifkin
    ```cpp
#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:

```cpp
<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;
      | ^
```

https://godbolt.org/z/vjYsWPq3q
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to