llvm-project
llvm-project copied to clipboard
The intersection of a concept which isn't satisfied and deducing this crashes clang 19
The following code crashes the compiler:
template<class T>
concept check_for = requires(T t) { check(t); };
struct foo{
template<class Self>
void check(this Self& self, int);
static_assert(check_for<int>);
};
https://godbolt.org/z/cTd3bna8G
It looks like this is fixed on trunk. However, I haven't been able to track down what fixed it so thought this bug report may be useful.
@llvm/issue-subscribers-clang-frontend
Author: Oliver Rosten (ojrosten)
The following code crashes the compiler:
template<class T>
concept check_for = requires(T t) { check(t); };
struct foo{
template<class Self>
void check(this Self& self, int);
static_assert(check_for<int>);
};
https://godbolt.org/z/cTd3bna8G
It looks like this is fixed on trunk. However, I haven't been able to track down what fixed it so thought this bug report may be useful.
This was fixed for #102025, with llvmorg-20-init-02565-g7332713b8ee ("[Clang] prevent null explicit object argument from being deduced (#104328)") by @a-tarasyuk CC @cor3ntin @mizvekov.