-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
Clang crash, when implementing "P2637R3 Member visit" #75819
Comments
@llvm/issue-subscribers-clang-frontend Author: Hristo Hristov (H-G-Hristov)
Added the following to libc++ header `<visit>`:
# if _LIBCPP_STD_VER >= 26
// [variant.visit], visitation
template <class _Self, class _Visitor>
constexpr decltype(auto) visit(this _Self&& __self, _Visitor&& __visitor) {
using _V = _OverrideRef<_Self&&, _CopyConst<remove_reference_t<_Self>, variant>>;
return std::visit(std::forward<_Visitor>(__visitor), (_V)__self);
}
template <class _R, class _Self, class _Visitor>
constexpr _R visit(this _Self&& __self, _Visitor&& __visitor) {
using _V = _OverrideRef<_Self&&, _CopyConst<remove_reference_t<_Self>, variant>>;
return std::visit<_R>(std::forward<_Visitor>(__visitor), (_V)__self);
}
# endif Added in libcxx/test/std/utilities/variant/variant.visit/visit.pass.cpp obj.visit(v);
assert(Fn::check_call<int &>(CT_NonConst | CT_LValue));
|
@cor3ntin Could this be a "deducing this" issue, which is the only "unusual" thing? |
This looks very similar to #75732 |
@H-G-Hristov the crash will be fixed by #75913 |
It's fixed. Thank you! |
Added the following to libc++ header
<visit>
:Added in libcxx/test/std/utilities/variant/variant.visit/visit.pass.cpp
The text was updated successfully, but these errors were encountered: