[Bug c++/107398] ICE in maybe_key_decl, at cp/module.cc:18834

2024-02-28 Thread nshead at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107398

Nathaniel Shead  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
   Assignee|unassigned at gcc dot gnu.org  |nshead at gcc dot 
gnu.org
   Target Milestone|--- |14.0
 CC||nshead at gcc dot gnu.org
 Resolution|--- |FIXED

--- Comment #2 from Nathaniel Shead  ---
Fixed for GCC 14.

[Bug c++/107398] ICE in maybe_key_decl, at cp/module.cc:18834

2023-11-23 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107398

--- Comment #1 from CVS Commits  ---
The master branch has been updated by Nathaniel Shead :

https://gcc.gnu.org/g:cff1fa6625d1273fcfaf473e436ba918262d8afa

commit r14-5810-gcff1fa6625d1273fcfaf473e436ba918262d8afa
Author: Nathaniel Shead 
Date:   Mon Nov 13 20:11:15 2023 +1100

c++: Support lambdas in static template member initialisers [PR107398]

The testcase noted in the PR fails because the context of the lambda is
not in namespace scope, but rather in class scope. This patch removes
the assertion that the context must be a namespace and ensures that
lambdas in class scope still get the correct merge_kind.

PR c++/107398

gcc/cp/ChangeLog:

* module.cc (trees_out::get_merge_kind): Handle lambdas in class
scope.
(maybe_key_decl): Remove assertion and fix whitespace.

gcc/testsuite/ChangeLog:

* g++.dg/modules/lambda-6_a.C: New test.
* g++.dg/modules/lambda-6_b.C: New test.

Signed-off-by: Nathaniel Shead