From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6A03E3858D39; Wed, 8 Feb 2023 08:56:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6A03E3858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675846589; bh=uj4nhq5RyqPz2exL8Ae/UWqTHSPZEjx3Dk9lPuz1kmo=; h=From:To:Subject:Date:From; b=FLGxIJP2uTlabnR2Bkc4Tmw1H6pr7aEhy1+d2I2mAeKTf1CwJ+KAvvqzTa0q8jQFi Pb5s8cEr34ViFSh8SIjNJYh3yX7hP4BSx5+iCMIwIIPQXoe+47igEofmLvLJg3DNqs gqBriY8cjBwrgS0xV8lcuex0m/LHLUZnt/lwfhLk= From: "b.stanimirov at abv dot bg" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/108714] New: Algorithms in require predicates to be copyable Date: Wed, 08 Feb 2023 08:56:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: b.stanimirov at abv dot bg X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108714 Bug ID: 108714 Summary: Algorithms in require predicates to be copyable Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: b.stanimirov at abv dot bg Target Milestone: --- Simple repro: ``` #include #include struct noncopyable { noncopyable(); noncopyable(const noncopyable&) =3D delete; noncopyable(noncopyable&&) noexcept =3D default; template bool operator()(const T&); }; bool all_of_vec(const std::vector& vec) { return std::all_of(vec.begin(), vec.end(), noncopyable{}); } ``` This does not compile, because the predicate to `all_of` is not copyable. T= he same error appears for all other algorithms which allow a predicate. It does compile and work and expected with Microsoft STL and with libc++ Live demo showing compilation errors with libstdc++ and successful compilat= ion with libc++ and Microsoft STL: https://godbolt.org/z/xaa35G35e=