-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Open
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"miscompilationregression:21
Description
I noticed that clang TOT fails to compile variadic templates with argument count exceeding 0x7fff. I plugged a simple reproducer into godbolt and noticed that this behavior starts at clang-21 (i.e. clang-20 compiles successfully).
The simplest repro I came up with was to simply instantiate a std::index_sequence
at various sizes, where the first static_assert()
succeeds and the second one fails:
namespace std {
typedef int a;
template <typename b, b... c> struct d {
constexpr a size() { return sizeof...(c); }
};
template <typename b, b e> using f = __make_integer_seq<d, b, e>;
template <a e> using make_index_sequence = f<a, e>;
} // namespace std
int main() {
constexpr unsigned SeqLength = 0x7fff;
std::make_index_sequence<SeqLength> Seq;
static_assert(Seq.size() == SeqLength);
{
constexpr unsigned SeqLength = 0x8000;
std::make_index_sequence<SeqLength> Seq;
static_assert(Seq.size() == SeqLength);
}
}
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"miscompilationregression:21