From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 688363858C60; Wed, 3 Nov 2021 18:56:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 688363858C60 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/70796] [DR 1030] Initialization order with braced-init-lists still broken Date: Wed, 03 Nov 2021 18:56:28 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 7.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW 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: cc 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: Wed, 03 Nov 2021 18:56:28 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D70796 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #5 from Jakub Jelinek --- #c3 in a single testcase without headers: struct A { int x =3D 0; A & operator ++ () { ++x; return *this; } }; struct B { A first, second; B (A x, A y) : first{x}, second{y} {} }; struct C { int first, second; C (int x, int y) : first{x}, second{y} {} }; void foo () { int i =3D 0; C p{++i, ++i}; if (p.first !=3D 1 || p.second !=3D 2) __builtin_abort (); } void bar () { int i =3D 0; C p{++i, ++i}; if (p.first !=3D 1 || p.second !=3D 2) __builtin_abort (); int &j =3D i; C q{++j, ++j}; if (q.first !=3D 3 || q.second !=3D 4) __builtin_abort (); } void baz () { int i =3D 0; C p{(int &) ++i, (int &) ++i}; if (p.first !=3D 1 || p.second !=3D 2) __builtin_abort (); } void qux () { A i; B p{++i, ++i}; if (p.first.x !=3D 1 || p.second.x !=3D 2) __builtin_abort (); } int main () { bar (); baz (); foo (); qux (); } Passes with clang++. Looking at the CALL, e.g. on C::C (&p, ++i, ++i) call CALL_EXPR_ORDERED_A= RGS is set and neither CALL_EXPR_REVERSE_ARGS nor CALL_EXPR_OPERATOR_SYNTAX is = set.=