From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 899E73858C2D; Tue, 26 Apr 2022 01:49:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 899E73858C2D From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/105289] [11/12 Regression] ICE on partial specialization Date: Tue, 26 Apr 2022 01:49:32 +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: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.4 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: Tue, 26 Apr 2022 01:49:32 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105289 --- Comment #3 from CVS Commits --- The master branch has been updated by Patrick Palka : https://gcc.gnu.org/g:288e4c64f6b4806358aabc9b99b2fba72bf04bf6 commit r12-8256-g288e4c64f6b4806358aabc9b99b2fba72bf04bf6 Author: Patrick Palka Date: Mon Apr 25 21:46:56 2022 -0400 c++: partial ordering with dependent NTTP type [PR105289] Here ever since r11-6483-ge2e2f3f2c9400f we're rejecting and crashing on (respectively) two testcases that we used to accept in C++17 mode since r8-1437-g3da557ec145823. Both testcases declare a partial specialization of a primary template that has an NTTP with dependent type, and the validity of these partial specializations is unclear and the subject of PR86193 / CWG 455. So for now, this minimal patch just aims to fix the crash in the second testcase. During deduction, when checking whether the type of an NTTP uses still-undeduced parameters, we were incorrectly substituting into the previously substituted type instead of into its original type. In passing this patch also downgrades the "not more specialized" diagnostic from a permerror to a pedwarn. PR c++/105289 PR c++/86193 gcc/cp/ChangeLog: * pt.cc (process_partial_specialization): Downgrade "partial specialization isn't more specialized" diagnostic from permerror to an on-by-default pedwarn. (unify) : When substituting into the NTTP type a second time, use the original type not the substituted type. gcc/testsuite/ChangeLog: * g++.dg/template/partial-specialization11.C: New test. * g++.dg/template/partial-specialization12.C: New test.=