From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6BC5C3939C14; Thu, 25 Feb 2021 21:39:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6BC5C3939C14 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/99103] Initializer-list constructors in CTAD for vector is still wrong Date: Thu, 25 Feb 2021 21:39:05 +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.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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: Thu, 25 Feb 2021 21:39:05 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99103 --- Comment #2 from CVS Commits --- The master branch has been updated by Patrick Palka : https://gcc.gnu.org/g:676f6f3277181662cf3ed07769edfa2d4fb7df28 commit r11-7405-g676f6f3277181662cf3ed07769edfa2d4fb7df28 Author: Patrick Palka Date: Thu Feb 25 16:38:08 2021 -0500 c++: Fix CTAD of single-element initializer list [PR99103] When determining whether to rule out initializer-list constructors during CTAD with a single-element initializer list (as per P0702), the element type's cv-qualifiers should be irrelevant. This patch fixes this by making is_spec_or_derived strip cv-qualifiers from the supplied expression type. In passing, I noticed in maybe_aggr_guide we were calling is_spec_or_derived with swapped arguments. This led us to prefer the aggregate deduction candidate over copying deduction in the second testcase below with -std=3Dc++20. gcc/cp/ChangeLog: PR c++/99103 * pt.c (is_spec_or_derived): Drop cv-qualifiers from 'etype'. (maybe_aggr_guide): Fix order of arguments to is_spec_or_derive= d. gcc/testsuite/ChangeLog: PR c++/99103 * g++.dg/cpp1z/class-deduction79.C: New test. * g++.dg/cpp1z/class-deduction80.C: New test.=