From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 46719398B153; Fri, 9 Apr 2021 08:57:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 46719398B153 From: "gcc-bugs at marehr dot dialup.fu-berlin.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/99433] [11 Regression] custom friend pipe-operator| conflicts with range adaptor? Date: Fri, 09 Apr 2021 08:57:25 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: gcc-bugs at marehr dot dialup.fu-berlin.de X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Apr 2021 08:57:25 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99433 --- Comment #7 from gcc-bugs at marehr dot dialup.fu-berlin.de --- Thank you for the quick analysis! > views=E2=80=8B::=E2=80=8Bdrop(E, F) is specified to be expression-equival= ent to the braced init ranges=E2=80=8B::=E2=80=8Bdrop_=C2=ADview{E, F} Is not completely true, right? As the narrowing warning shows: ``` libstdc++-v3/include/std/ranges:2101:24: warning: narrowing conversion of =E2=80=98std::declval()=E2=80=99 from =E2=80=98long unsi= gned int=E2=80=99 to =E2=80=98std::ranges::range_difference_t > >=E2=80=99 {aka =E2=80=98long int=E2=80=99} [-Wnarrowing] ``` There is some `std::views::all` involved. But the following expressions ``` #include #include int main() { std::list list; // std::views::drop(list, 0ull); // does not compile std::ranges::drop_view{list, 0ull}; // does compile without warnings std::ranges::drop_view{std::views::all(list), 0ull}; // does compile with= out warnings } ``` do compile without any warnings when using `g++-11 -std=3Dc++2a -pedantic -= Wall -Wextra`! Even when adding `-Wsystem-headers` there is no "narrowing" warning found in those expressions. Thank you for your incredible help!=