-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
Ranges pipe syntax broken after commit #c1086532d4d5 when using std module. #89898
Comments
@stripe2933 Is this still an issue after #89793? |
I tested the code with template <class _Tp>
requires is_class_v<_Tp> && same_as<_Tp, remove_cv_t<_Tp>>
struct __range_adaptor_closure {
template <ranges::range _Range, _RangeAdaptorClosure _Closure>
requires same_as<_Tp, remove_cvref_t<_Closure>> && invocable<_Closure, _Range>
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr decltype(auto)
operator|(_Range&& __range, _Closure&& __closure) noexcept(is_nothrow_invocable_v<_Closure, _Range>) {
return std::invoke(std::forward<_Closure>(__closure), std::forward<_Range>(__range));
}
template <_RangeAdaptorClosure _Closure, _RangeAdaptorClosure _OtherClosure>
requires same_as<_Tp, remove_cvref_t<_Closure>> && constructible_from<decay_t<_Closure>, _Closure> &&
constructible_from<decay_t<_OtherClosure>, _OtherClosure>
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator|(_Closure&& __c1, _OtherClosure&& __c2) noexcept(
is_nothrow_constructible_v<decay_t<_Closure>, _Closure> &&
is_nothrow_constructible_v<decay_t<_OtherClosure>, _OtherClosure>) {
return __range_adaptor_closure_t(std::__compose(std::forward<_OtherClosure>(__c2), std::forward<_Closure>(__c1)));
}
}; |
@ChuanqiXu9 Is this possibly a bug in the C++20 Modules implementation? |
There seem to be two issues
I'll look at both issues. |
This was omitted in c108653 and not detected by the CI since clang-tidy is not running. This fixes the exports. Fixes: llvm#89898
The patch does several things: - fixes module exports - disables clang-tidy with Clang-17 due to known issues - disabled clang-tidy on older libstdc++ versions since it lacks C++20 features used - fixes the CMake dependency The issue why clang-tidy was not used in the CI was the last issue; the plugin was not a dependency of the tests. Without a plugin the tests disable clang-tidy. This was noticed while investigating #89898
The following code
works correctly (godbolt link) in Clang trunk. However, when changing the header inclusion to
import std;
, then the code will emit error:Compiler: Clang 18.1.4, Libc++: trunk.
I followed the standard library module instruction documented in libc++ document.
I noticed that the commits before
c1086532d4d5
, which corresponds to the PR #89148 does not print this error. It seems that the PR is problem.The text was updated successfully, but these errors were encountered: