-
Notifications
You must be signed in to change notification settings - Fork 13.4k
ICE in forward from deduced this in lambda #68070
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@llvm/issue-subscribers-clang-frontend
Huge thanks for landing P0847R7 in clang.
This short snippet crashes clang built from f58d54a #include <utility>
auto f = [x = 3]<typename Self>(this Self&& self)
{
return std::forward_like<Self>(x);
};
int main()
{
return std::move(f)();
}
The synonymous construction from a hand written type does not cause a crash. #include <utility>
struct S
{
int x = 3;
template <typename Self>
auto operator()(this Self&& self)
{
return std::forward_like<Self>(self.x);
}
};
int main()
{
S s;
return std::move(s)();
} |
Looks like the constant expression evaluator expects a non-null
|
with an explicit parameter. Fixes llvm#68070
with an explicit parameter. We tried to read a pointer to a non-existent `This` APValue when constant-evaluating an explicit object lambda call operator (the `this` pointer is never set in explicit object member functions) Fixes #68070
Awesome @cor3ntin, thank you! |
Any time! Thanks for trying |
Huge thanks for landing P0847R7 in clang.
This short snippet crashes clang built from f58d54a
The synonymous construction from a hand written type does not cause a crash.
The text was updated successfully, but these errors were encountered: