From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 77CEE3857C46; Tue, 18 Jan 2022 15:10:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 77CEE3857C46 From: "richard.corden at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/104098] New: bits/stl_iterator.h fails to compile for __cplusplus > 201703L but with __cpp_concepts undefined Date: Tue, 18 Jan 2022 15:10:10 +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: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: richard.corden at gmail dot com 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 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: Tue, 18 Jan 2022 15:10:10 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104098 Bug ID: 104098 Summary: bits/stl_iterator.h fails to compile for __cplusplus > 201703L but with __cpp_concepts undefined Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: richard.corden at gmail dot com Target Milestone: --- Hi, The following commit changed a preprocessor condition, removing a check for __cpp_lib_concepts: =20 https://github.com/gcc-mirror/gcc/commit/d5cbe0f0d4b7bc11f80b2236521f90ec94= e95767#diff-d1fe6b9164baa7e8e1119a4d194b6b2481439be0cdf5da5794e8001537db4e84 The result being that this header cannot be used with __cplusplus after 201= 703L unless "__cpp_concepts" is defined. Compiling the following with "g++ -std=3Dc++20 sample.cpp" reproduces the i= ssue: {code:c++} // sample.cpp #undef __cpp_concepts #include {code} {noformat} > g++-11 -std=3Dc++20 sample.cpp In file included from /usr/include/c++/11/bits/stl_algobase.h:67, from /usr/include/c++/11/vector:60, from sample.cpp:3: /usr/include/c++/11/bits/stl_iterator.h:158:25: error: =E2=80=98random_acce= ss_iterator=E2=80=99 was not declared in this scope; did you mean =E2=80=98random_access_iterato= r_tag=E2=80=99? 158 | =3D conditional_t, | ^~~~~~~~~~~~~~~~~~~~~~ | random_access_iterator_tag /usr/include/c++/11/bits/stl_iterator.h:158:57: error: wrong number of temp= late arguments (1, should be 3) 158 | =3D conditional_t, | ^ In file included from /usr/include/c++/11/bits/move.h:57, from /usr/include/c++/11/bits/stl_pair.h:59, from /usr/include/c++/11/bits/stl_algobase.h:64, from /usr/include/c++/11/vector:60, from sample.cpp:3: {noformat} The following addresses the issue for me locally: {code:c++} #if __cplusplus <=3D 201703L || ! defined (__cpp_lib_concepts) {code} Cheers, Richard=