[Bug c++/125043] [14/15/16/17 Regression] ICE in passing invalid constant template argument

2026-05-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125043

--- Comment #3 from GCC Commits  ---
The releases/gcc-16 branch has been updated by Marek Polacek
:

https://gcc.gnu.org/g:547f09d1ea1ac4538b998d5d15aac0b9f08cbcbb

commit r16-8898-g547f09d1ea1ac4538b998d5d15aac0b9f08cbcbb
Author: Marek Polacek 
Date:   Thu May 7 18:09:57 2026 -0400

c++: fix ICE with invalid targ [PR125043]

The patch that allowed DECL_NTTP_OBJECT_P in invalid_tparm_referent_p
also added the assert checking for tinfos/__func__ (r14-8189).  But in
these tests we got to the assert with a temporary object coming from
create_temporary_var: either a reference temporary or compound literal
temporary.  The former could be checked by seeing if the name starts
with _ZGR but the latter don't have it.  So perhaps we can just check
DECL_IGNORED_P, always set for create_temporary_var objects.

PR c++/115181
PR c++/125043
PR c++/124979

gcc/cp/ChangeLog:

* pt.cc (invalid_tparm_referent_p): Allow DECL_IGNORED_P in an
assert.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1z/nontype-auto27.C: New test.
* g++.dg/cpp1z/nontype-auto28.C: New test.
* g++.dg/cpp2a/nontype-class75.C: New test.

Reviewed-by: Jason Merrill 
(cherry picked from commit 90ec6eeca09f5a411fd7878e2532a7ac2f2e3d71)

[Bug c++/125043] [14/15/16/17 Regression] ICE in passing invalid constant template argument

2026-05-08 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125043

--- Comment #2 from GCC Commits  ---
The trunk branch has been updated by Marek Polacek :

https://gcc.gnu.org/g:90ec6eeca09f5a411fd7878e2532a7ac2f2e3d71

commit r17-416-g90ec6eeca09f5a411fd7878e2532a7ac2f2e3d71
Author: Marek Polacek 
Date:   Thu May 7 18:09:57 2026 -0400

c++: fix ICE with invalid targ [PR125043]

The patch that allowed DECL_NTTP_OBJECT_P in invalid_tparm_referent_p
also added the assert checking for tinfos/__func__ (r14-8189).  But in
these tests we got to the assert with a temporary object coming from
create_temporary_var: either a reference temporary or compound literal
temporary.  The former could be checked by seeing if the name starts
with _ZGR but the latter don't have it.  So perhaps we can just check
DECL_IGNORED_P, always set for create_temporary_var objects.

PR c++/115181
PR c++/125043
PR c++/124979

gcc/cp/ChangeLog:

* pt.cc (invalid_tparm_referent_p): Allow DECL_IGNORED_P in an
assert.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1z/nontype-auto27.C: New test.
* g++.dg/cpp1z/nontype-auto28.C: New test.
* g++.dg/cpp2a/nontype-class75.C: New test.

Reviewed-by: Jason Merrill 

[Bug c++/125043] [14/15/16/17 Regression] ICE in passing invalid constant template argument

2026-05-07 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125043

Marek Polacek  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org

[Bug c++/125043] [14/15/16/17 Regression] ICE in passing invalid constant template argument

2026-04-28 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125043

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug c++/125043] [/14/15/16/17 Regression] ICE in passing invalid constant template argument

2026-04-27 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125043

Marek Polacek  changed:

   What|Removed |Added

 CC||ppalka at gcc dot gnu.org
   Target Milestone|--- |14.4
Summary|regression: ICE in passing  |[/14/15/16/17 Regression]
   |invalid constant template   |ICE in passing invalid
   |argument|constant template argument