[Bug c++/105289] [11 Regression] ICE on partial specialization
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105289 Patrick Palka changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED --- Comment #8 from Patrick Palka --- Fixed -- PR86193 remains open to deal with the question of validity of such partial specializations.
[Bug c++/105289] [11 Regression] ICE on partial specialization
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105289 --- Comment #7 from CVS Commits --- The releases/gcc-11 branch has been updated by Patrick Palka : https://gcc.gnu.org/g:c4332c785c8e993104a4d76d86c737b51a636aee commit r11-9945-gc4332c785c8e993104a4d76d86c737b51a636aee 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.c (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. (cherry picked from commit 288e4c64f6b4806358aabc9b99b2fba72bf04bf6)
[Bug c++/105289] [11 Regression] ICE on partial specialization
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105289 --- Comment #6 from Michael Steinberg --- (In reply to Patrick Palka from comment #4) > (In reply to Michael Steinberg from comment #2) > > Created attachment 52851 [details] > > Working modified partial specialization > > > > I suppose ice-on-invalid-code might be the more convenient classification > since after the above patch we now just reject the original testcase instead > of crashing. This way the question of validity is left entirely to PR86193. Even though this is my code that worked before, I would lean towards calling it invalid given the standard. ;) But on the other hand, one would need to take into consideration, if deducing parameters by use of a single specialization with an empty primary template is a usage common enough for a special rule allowing for the base template to set an implicit lower bar to the specializations. I don't mind repeating the constraints though.
[Bug c++/105289] [11 Regression] ICE on partial specialization
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105289 Patrick Palka changed: What|Removed |Added Summary|[11/12 Regression] ICE on |[11 Regression] ICE on |partial specialization |partial specialization --- Comment #5 from Patrick Palka --- Fixed for GCC 12 so far