public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/107398] New: ICE in maybe_key_decl, at cp/module.cc:18834
@ 2022-10-25 17:30 gscfq@t-online.de
  2023-11-24  2:32 ` [Bug c++/107398] " cvs-commit at gcc dot gnu.org
  2024-02-29  5:06 ` nshead at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: gscfq@t-online.de @ 2022-10-25 17:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107398

            Bug ID: 107398
           Summary: ICE in maybe_key_decl, at cp/module.cc:18834
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Started wirh r11, using e.g. file g++.dg/cpp0x/lambda/lambda-mangle6.C :
(gcc configured with --enable-checking=yes)


$ g++-13-20221023 -c lambda-mangle6.C -fmodules-ts
lambda-mangle6.C:10:37: internal compiler error: in maybe_key_decl, at
cp/module.cc:18834
   10 | template<typename T> int R<T>::x = []{int i; return 1;}();
      |                                     ^
0x9b303e maybe_key_decl(tree_node*, tree_node*)
        ../../gcc/cp/module.cc:18834
0xa052fb cp_parser_lambda_expression
        ../../gcc/cp/parser.cc:11033
0xa052fb cp_parser_primary_expression
        ../../gcc/cp/parser.cc:5766
0xa08d9e cp_parser_postfix_expression
        ../../gcc/cp/parser.cc:7717
0xa20fef cp_parser_unary_expression
        ../../gcc/cp/parser.cc:9081
0x9ebd2f cp_parser_cast_expression
        ../../gcc/cp/parser.cc:9985
0x9ec65f cp_parser_binary_expression
        ../../gcc/cp/parser.cc:10087
0x9ed404 cp_parser_assignment_expression
        ../../gcc/cp/parser.cc:10427
0x9f0275 cp_parser_constant_expression
        ../../gcc/cp/parser.cc:10722
0x9f1791 cp_parser_initializer_clause
        ../../gcc/cp/parser.cc:25333
0x9f3f0b cp_parser_initializer
        ../../gcc/cp/parser.cc:25273
0xa2eb4c cp_parser_init_declarator
        ../../gcc/cp/parser.cc:22838
0xa32e1f cp_parser_single_declaration
        ../../gcc/cp/parser.cc:31903
0xa32f85 cp_parser_template_declaration_after_parameters
        ../../gcc/cp/parser.cc:31456
0xa33c8f cp_parser_explicit_template_declaration
        ../../gcc/cp/parser.cc:31729
0xa33c8f cp_parser_template_declaration_after_export
        ../../gcc/cp/parser.cc:31748
0xa36316 cp_parser_declaration
        ../../gcc/cp/parser.cc:14899
0xa372b8 cp_parser_translation_unit
        ../../gcc/cp/parser.cc:5076
0xa372b8 c_parse_file()
        ../../gcc/cp/parser.cc:48856
0xbcfb01 c_common_parse_file()
        ../../gcc/c-family/c-opts.cc:1247

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/107398] ICE in maybe_key_decl, at cp/module.cc:18834
  2022-10-25 17:30 [Bug c++/107398] New: ICE in maybe_key_decl, at cp/module.cc:18834 gscfq@t-online.de
@ 2023-11-24  2:32 ` cvs-commit at gcc dot gnu.org
  2024-02-29  5:06 ` nshead at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-11-24  2:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107398

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Nathaniel Shead <nshead@gcc.gnu.org>:

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

commit r14-5810-gcff1fa6625d1273fcfaf473e436ba918262d8afa
Author: Nathaniel Shead <nathanieloshead@gmail.com>
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 <nathanieloshead@gmail.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/107398] ICE in maybe_key_decl, at cp/module.cc:18834
  2022-10-25 17:30 [Bug c++/107398] New: ICE in maybe_key_decl, at cp/module.cc:18834 gscfq@t-online.de
  2023-11-24  2:32 ` [Bug c++/107398] " cvs-commit at gcc dot gnu.org
@ 2024-02-29  5:06 ` nshead at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: nshead at gcc dot gnu.org @ 2024-02-29  5:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107398

Nathaniel Shead <nshead at gcc dot gnu.org> 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 <nshead at gcc dot gnu.org> ---
Fixed for GCC 14.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-29  5:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-25 17:30 [Bug c++/107398] New: ICE in maybe_key_decl, at cp/module.cc:18834 gscfq@t-online.de
2023-11-24  2:32 ` [Bug c++/107398] " cvs-commit at gcc dot gnu.org
2024-02-29  5:06 ` nshead at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).