From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BA51C385B20F; Fri, 15 Apr 2022 15:44:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BA51C385B20F From: "jason at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/101500] [C++17] [DR2311] gcc accepts the code with extra curly braces Date: Fri, 15 Apr 2022 15:44:06 +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: 11.1.0 X-Bugzilla-Keywords: accepts-invalid X-Bugzilla-Severity: normal X-Bugzilla-Who: jason at gcc dot gnu.org X-Bugzilla-Status: SUSPENDED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 9.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: short_desc bug_status bug_file_loc 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, 15 Apr 2022 15:44:06 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101500 Jason Merrill changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|[9/10/11/12 Regression] gcc |[C++17] [DR2311] gcc |accepts the code with extra |accepts the code with extra |curly braces |curly braces Status|NEW |SUSPENDED URL| |wg21.link/cwg2311 --- Comment #2 from Jason Merrill --- This seems like an instance of issue 2311: with C++17 mandatory copy elisio= n, do we really want an actual call to the move constructor in this case? The testcase is rejected in C++14 mode, as expected. The standard says that we try to call a constructor, initializing the argum= ent with {A{}}. So we in turn look for an A constructor to initialize the argument, initializing its argument from A{}. Under 2311, does this result= in still an rvalue? And the enclosing constructor call, still the same rvalue? This seems parallel to const A a =3D A(A(A())); which is also accepted by clang in C++17 mode. Perhaps we want to raise the priority of issue 2311.=