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

            Bug ID: 94507
           Summary: internal compiler error: tree check: expected
                    template_decl, have error_mark in tsubst_lambda_expr
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

struct S { };

template<typename T, typename U>
auto foo(T, U)
{
  [] <> () { foo (S{}, S{}); };
}

$ ./cc1plus -quiet -std=c++20 z.C
z.C: In function ‘auto foo(T, U)’:
z.C:6:7: error: expected identifier before ‘>’ token
    6 |   [] <> () { foo (S{}, S{}); };
      |       ^
z.C: In instantiation of ‘auto foo(T, U) [with T = S; U = S]’:
z.C:6:27:   required from here
z.C:6:3: note: invalid template non-type parameter
    6 |   [] <> () { foo (S{}, S{}); };
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
z.C:6:3: internal compiler error: tree check: expected template_decl, have
error_mark in tsubst_lambda_expr, at cp/pt.c:18880
0x19afd31 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        /home/mpolacek/src/gcc/gcc/tree.c:9727
0x912e6b tree_check(tree_node*, char const*, int, char const*, tree_code)
        /home/mpolacek/src/gcc/gcc/tree.h:3279
0xbe40a1 tsubst_lambda_expr(tree_node*, tree_node*, int, tree_node*)
        /home/mpolacek/src/gcc/gcc/cp/pt.c:18880
0xbeb2fb tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        /home/mpolacek/src/gcc/gcc/cp/pt.c:20321
0xbe2d59 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/mpolacek/src/gcc/gcc/cp/pt.c:18614
0xbdb83f tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/mpolacek/src/gcc/gcc/cp/pt.c:17727
0xbdb5d1 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/mpolacek/src/gcc/gcc/cp/pt.c:17697
0xbde18e tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/mpolacek/src/gcc/gcc/cp/pt.c:18015
0xc01c32 instantiate_decl(tree_node*, bool, bool)
        /home/mpolacek/src/gcc/gcc/cp/pt.c:25539
0xc025eb instantiate_pending_templates(int)
        /home/mpolacek/src/gcc/gcc/cp/pt.c:25655
0xa66864 c_parse_final_cleanups()
        /home/mpolacek/src/gcc/gcc/cp/decl2.c:4874
0xd45bae c_common_parse_file()
        /home/mpolacek/src/gcc/gcc/c-family/c-opts.c:1212
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.

Reply via email to