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

            Bug ID: 100054
           Summary: internal compiler error: in get_nsdmi
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: barry.revzin at gmail dot com
  Target Milestone: ---

Reduced with creduce and then by hand:

template <typename n>
struct C {
  void find() {
    struct H {
        C<n> c{};
    };
    (void)[](auto){ return H{}; };
  }
};

void f() {
  C<int>().find();
}

This fails on gcc trunk -std=c++20 (but worked on gcc 10.3, 10.2, 10.1) with
(https://godbolt.org/z/heEKjMn91):

<source>: In instantiation of 'void C<n>::find() [with n = int]':
<source>:12:16:   required from here
<source>:5:14: internal compiler error: in get_nsdmi, at cp/init.c:598
    5 |         C<n> c{};
      |              ^
0x1d01009 internal_error(char const*, ...)
        ???:0
0x6bb009 fancy_abort(char const*, int, char const*)
        ???:0
0x7fa161 get_nsdmi(tree_node*, bool, int)
        ???:0
0x97f2eb finish_compound_literal(tree_node*, tree_node*, int, fcl_t)
        ???:0
0x94ae62 tsubst_lambda_expr(tree_node*, tree_node*, int, tree_node*)
        ???:0
0x91699a tsubst_tree_list(tree_node*, tree_node*, int, tree_node*)
        ???:0
0x91d7ef instantiate_decl(tree_node*, bool, bool)
        ???:0
0x95f69b instantiate_pending_templates(int)
        ???:0
0x7cd039 c_parse_final_cleanups()
        ???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
ASM generation compiler returned: 1
<source>: In instantiation of 'void C<n>::find() [with n = int]':
<source>:12:16:   required from here
<source>:5:14: internal compiler error: in get_nsdmi, at cp/init.c:598
    5 |         C<n> c{};
      |              ^
0x1d01009 internal_error(char const*, ...)
        ???:0
0x6bb009 fancy_abort(char const*, int, char const*)
        ???:0
0x7fa161 get_nsdmi(tree_node*, bool, int)
        ???:0
0x97f2eb finish_compound_literal(tree_node*, tree_node*, int, fcl_t)
        ???:0
0x94ae62 tsubst_lambda_expr(tree_node*, tree_node*, int, tree_node*)
        ???:0
0x91699a tsubst_tree_list(tree_node*, tree_node*, int, tree_node*)
        ???:0
0x91d7ef instantiate_decl(tree_node*, bool, bool)
        ???:0
0x95f69b instantiate_pending_templates(int)
        ???:0
0x7cd039 c_parse_final_cleanups()
        ???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Execution build compiler returned: 1

Reply via email to