llvm-project
llvm-project copied to clipboard
clang: regression - template partial specialization with integer_sequence
Partial specialization of a template with an integer sequence or similar seems to be failing.
#include <utility>
template <typename L> struct S;
template <template <typename, auto...> typename L, typename T, T... Vs>
struct S<L<T, Vs...>> {
constexpr static auto value = 0;
};
auto main() -> int {
using T = std::make_index_sequence<3>;
return S<T>::value;
}
https://godbolt.org/z/GY9M44nzM
Produces:
<source>:12:12: error: implicit instantiation of undefined template 'S<std::integer_sequence<unsigned long, 0, 1, 2>>'
12 | return S<T>::value;
| ^
This seems to be a regression after clang-19.
CC @zyn0217
@llvm/issue-subscribers-clang-frontend
Author: Ben Deane (elbeno)
Partial specialization of a template with an integer sequence or similar seems to be failing.
#include <utility>
template <typename L> struct S;
template <template <typename, auto...> typename L, typename T, T... Vs>
struct S<L<T, Vs...>> {
constexpr static auto value = 0;
};
auto main() -> int {
using T = std::make_index_sequence<3>;
return S<T>::value;
}
https://godbolt.org/z/GY9M44nzM
Produces:
<source>:12:12: error: implicit instantiation of undefined template 'S<std::integer_sequence<unsigned long, 0, 1, 2>>'
12 | return S<T>::value;
| ^
This seems to be a regression after clang-19.
Looks like #130778. See https://github.com/llvm/llvm-project/issues/130992#issuecomment-2718890171 for a fix.