From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E36F2385E83E; Wed, 15 May 2024 20:52:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E36F2385E83E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1715806330; bh=u/Pd1DYujHrF/opO0Y50szgykEuIjleINSkpd7HVWA8=; h=From:To:Subject:Date:From; b=d/hWWQC22KgZAPtmnfstGvNJU/lUj/V3ruLzD0J7IW5LvRKKhXEGva+5cozj6XQ/D /5mMd4JJDYlEFilIkJtVu9WwTJt7tC9J+9/kfXpfP9ZloyUe0MMbn6nub4bUCDXBBL 3EH01RqmhCMOBu6V8ZkV8OC//RwB/QnleZ3X8y3E= From: "eric.niebler at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/115114] New: aggregate initialization with parens fails when there is a base class Date: Wed, 15 May 2024 20:52:09 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 15.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: eric.niebler 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D115114 Bug ID: 115114 Summary: aggregate initialization with parens fails when there is a base class Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: eric.niebler at gmail dot com Target Milestone: --- I believe the following is valid C++20: struct get_answer {}; template struct with : Query { Value value; }; int main() { with w1{get_answer(), 42}; // works with w2(get_answer(), 42); // fails } clang and msvc accept this code. gcc-trunk rejects it. See https://godbolt.org/z/KvGjn47f9. If I change the definition of the `with` class template to the following, t= he code compiles: template struct with { Query query; Value value; };=