From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 528C13858C20; Tue, 6 Feb 2024 10:41:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 528C13858C20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707216087; bh=+Oaj0tbpYzRSSNv3qmZwOJd6sJ+TxatO8ZoPEMcGeNY=; h=From:To:Subject:Date:From; b=VzdlV9HO77Vyv7JDYtLKJMTLmmCdPGCmHb/Yl6/MeeWIB8QGZp2YAlDpLBHmArBnL Njmoq4Dcy9j03w9n6/uz8vKSp+Eygwy7SuW8v7YXhY55hMGr0NZ6ylZVvclsPBBVmZ I5jcqL7wEZnydFCtntsp1L4tCNWi2J+83DqjoovU= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/113782] New: constexpr on std::initializer_list, std::pair and std::tuple is non-conforming for C++11 Date: Tue, 06 Feb 2024 10:41:26 +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: 14.0 X-Bugzilla-Keywords: accepts-invalid X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org 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 keywords 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=3D113782 Bug ID: 113782 Summary: constexpr on std::initializer_list, std::pair and std::tuple is non-conforming for C++11 Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: accepts-invalid Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org Target Milestone: --- https://wg21.link/N3471 should be a C++14 change, not present in C++11 mode. i.e. this should be rejected with -std=3Dc++11 #include #include #include constexpr std::initializer_list il{1,2,3}; constexpr int i =3D std::move(*il.begin()) + end(il)[-1] + (int)il.size(); constexpr std::pair p{1, 2}; constexpr int j =3D std::get<0>(p) + (int)(p =3D=3D p); constexpr std::tuple t{1}; initializer_list changes: r0-104226-g900484dee595d9 (this adds FE tests using -std=3Dc++0x) function changes: r0-110341-g9b9e81a0a9cef8 (also touched std::pair) std::tuple and std::pair changes: r0-104899-g094a14eff78e4f=