On Thu, 10 Dec 2020, Patrick Palka wrote:

> This patch further extends the satisfaction_cache class to diagnose
> self-recursive satisfaction.
> 
> With this patch, a few more cmcstl2 tests fail at compile time due apparent
> self-recursive satisfaction.  I didn't analyze these failures
> individually, but all errors contain view_interface::operator bool() in
> their template instantiation backtrace, and applying a workaround
> similar to PR97600#c3 to include/stl2/view/view_interface.hpp fixes all
> observed failures.

Whoops, I meant to say #c2 not #c3 here.  For the record, here's the
workaround in question:

diff --git a/include/stl2/view/view_interface.hpp 
b/include/stl2/view/view_interface.hpp
index ace9e983..dea29896 100644
--- a/include/stl2/view/view_interface.hpp
+++ b/include/stl2/view/view_interface.hpp
@@ -84,14 +84,15 @@ STL2_OPEN_NAMESPACE {
                        return begin(d) == end(d);
                }
 
-               constexpr explicit operator bool()
+               template<same_as<bool> T>
+               constexpr explicit operator T()
                // Distinct named concept to workaround 
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82740
                requires detail::CanEmpty<D> {
                        return !__stl2::empty(derived());
                }
                // Distinct named concept to workaround 
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82740
-               template<detail::CanEmpty = const D> // gcc_bugs_bugs_bugs
-               constexpr explicit operator bool() const {
+               template<same_as<bool> T, detail::CanEmpty = const D> // 
gcc_bugs_bugs_bugs
+               constexpr explicit operator T() const {
                        return !__stl2::empty(derived());
                }
                template<range R = D>

Reply via email to