public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "asolokha at gmx dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108972] New: ICE: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in compare_lambda_template_head, at cp/lambda.cc:1551 Date: Tue, 28 Feb 2023 17:09:50 +0000 [thread overview] Message-ID: <bug-108972-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108972 Bug ID: 108972 Summary: ICE: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in compare_lambda_template_head, at cp/lambda.cc:1551 Product: gcc Version: 13.0 Status: UNCONFIRMED Keywords: ice-on-invalid-code, lto Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: asolokha at gmx dot com CC: marxin at gcc dot gnu.org, unassigned at gcc dot gnu.org Target Milestone: --- +++ This bug was initially created as a clone of Bug #108971 +++ gcc 13.0.1 20230226 snapshot (g:e6d39f68d03c46637ca6e1bede3d28eae6278df3) ICEs when compiling the following testcase, reduced from gcc/testsuite/g++.dg/cpp2a/concepts-lambda3.C, w/ -fbranch-probabilities -flto -fno-inline: template<typename T> concept C1 = __is_same_as(T, int); template<typename T> concept IsNotTiny = !__is_same_as(T, char); void foo () { auto g = []<C1 T> requires IsNotTiny<T>(T t) -> T requires IsNotTiny<decltype(t)> { return t; }; [](auto t) requires true { return t; }(5); [](C1 auto t) { return t; }(5); auto a0 = [](IsNotTiny auto a) { return [](auto b){ return b; }; }; auto a1 = a0(1); } % g++-13 -fbranch-probabilities -flto -fno-inline -c sanpvd3f.C sanpvd3f.C:2:1: error: 'concept' does not name a type; did you mean 'const'? 2 | concept C1 = __is_same_as(T, int); | ^~~~~~~ | const sanpvd3f.C:2:1: note: 'concept' only available with '-std=c++20' or '-fconcepts' sanpvd3f.C:5:1: error: 'concept' does not name a type; did you mean 'const'? 5 | concept IsNotTiny = !__is_same_as(T, char); | ^~~~~~~ | const sanpvd3f.C:5:1: note: 'concept' only available with '-std=c++20' or '-fconcepts' sanpvd3f.C: In function 'void foo()': sanpvd3f.C:10:15: error: 'C1' has not been declared 10 | auto g = []<C1 T> requires IsNotTiny<T>(T t) -> T | ^~ sanpvd3f.C:10:21: error: 'requires' only available with '-std=c++20' or '-fconcepts' 10 | auto g = []<C1 T> requires IsNotTiny<T>(T t) -> T | ^~~~~~~~ sanpvd3f.C:10:30: error: 'IsNotTiny' was not declared in this scope 10 | auto g = []<C1 T> requires IsNotTiny<T>(T t) -> T | ^~~~~~~~~ sanpvd3f.C:10:40: error: 'T' was not declared in this scope 10 | auto g = []<C1 T> requires IsNotTiny<T>(T t) -> T | ^ sanpvd3f.C:10:43: error: 'T' was not declared in this scope 10 | auto g = []<C1 T> requires IsNotTiny<T>(T t) -> T | ^ sanpvd3f.C:10:44: error: expected ')' before 't' 10 | auto g = []<C1 T> requires IsNotTiny<T>(T t) -> T | ~ ^~ | ) sanpvd3f.C: In lambda function: sanpvd3f.C:11:50: error: expected '{' before ';' token 11 | requires IsNotTiny<decltype(t)> { return t; }; | ^ sanpvd3f.C: In function 'void foo()': sanpvd3f.C:13:14: error: 'requires' only available with '-std=c++20' or '-fconcepts' 13 | [](auto t) requires true { return t; }(5); | ^~~~~~~~ sanpvd3f.C:13:23: internal compiler error: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in compare_lambda_template_head, at cp/lambda.cc:1551 13 | [](auto t) requires true { return t; }(5); | ^~~~ 0x896ef7 tree_contains_struct_check_failed(tree_node const*, tree_node_structure_enum, char const*, int, char const*) /var/tmp/portage/sys-devel/gcc-13.0.1_p20230226/work/gcc-13-20230226/gcc/tree.cc:9083 0x70171c contains_struct_check(tree_node*, tree_node_structure_enum, char const*, int, char const*) /var/tmp/portage/sys-devel/gcc-13.0.1_p20230226/work/gcc-13-20230226/gcc/tree.h:3644 0x70171c compare_lambda_template_head /var/tmp/portage/sys-devel/gcc-13.0.1_p20230226/work/gcc-13-20230226/gcc/cp/lambda.cc:1551 0xa6a86c compare_lambda_sig /var/tmp/portage/sys-devel/gcc-13.0.1_p20230226/work/gcc-13-20230226/gcc/cp/lambda.cc:1598 0xa6a86c record_lambda_scope_sig_discriminator(tree_node*, tree_node*) /var/tmp/portage/sys-devel/gcc-13.0.1_p20230226/work/gcc-13-20230226/gcc/cp/lambda.cc:1656 0xb234b8 cp_parser_lambda_declarator_opt /var/tmp/portage/sys-devel/gcc-13.0.1_p20230226/work/gcc-13-20230226/gcc/cp/parser.cc:11774 0xb05f86 cp_parser_lambda_expression /var/tmp/portage/sys-devel/gcc-13.0.1_p20230226/work/gcc-13-20230226/gcc/cp/parser.cc:11142 0xb06d63 cp_parser_primary_expression /var/tmp/portage/sys-devel/gcc-13.0.1_p20230226/work/gcc-13-20230226/gcc/cp/parser.cc:5826 0xb095e6 cp_parser_postfix_expression /var/tmp/portage/sys-devel/gcc-13.0.1_p20230226/work/gcc-13-20230226/gcc/cp/parser.cc:7777 0xaf1454 cp_parser_binary_expression /var/tmp/portage/sys-devel/gcc-13.0.1_p20230226/work/gcc-13-20230226/gcc/cp/parser.cc:10147 0xaf2332 cp_parser_assignment_expression /var/tmp/portage/sys-devel/gcc-13.0.1_p20230226/work/gcc-13-20230226/gcc/cp/parser.cc:10490 0xaf4784 cp_parser_expression /var/tmp/portage/sys-devel/gcc-13.0.1_p20230226/work/gcc-13-20230226/gcc/cp/parser.cc:10660 0xaf88b7 cp_parser_expression_statement /var/tmp/portage/sys-devel/gcc-13.0.1_p20230226/work/gcc-13-20230226/gcc/cp/parser.cc:12804 0xb041db cp_parser_statement /var/tmp/portage/sys-devel/gcc-13.0.1_p20230226/work/gcc-13-20230226/gcc/cp/parser.cc:12584 0xb0530d cp_parser_statement_seq_opt /var/tmp/portage/sys-devel/gcc-13.0.1_p20230226/work/gcc-13-20230226/gcc/cp/parser.cc:12955 0xb053d7 cp_parser_compound_statement /var/tmp/portage/sys-devel/gcc-13.0.1_p20230226/work/gcc-13-20230226/gcc/cp/parser.cc:12907 0xb28b54 cp_parser_function_body /var/tmp/portage/sys-devel/gcc-13.0.1_p20230226/work/gcc-13-20230226/gcc/cp/parser.cc:25323 0xb28b54 cp_parser_ctor_initializer_opt_and_function_body /var/tmp/portage/sys-devel/gcc-13.0.1_p20230226/work/gcc-13-20230226/gcc/cp/parser.cc:25374 0xb2ac00 cp_parser_function_definition_after_declarator /var/tmp/portage/sys-devel/gcc-13.0.1_p20230226/work/gcc-13-20230226/gcc/cp/parser.cc:31995 0xb2c152 cp_parser_function_definition_from_specifiers_and_declarator /var/tmp/portage/sys-devel/gcc-13.0.1_p20230226/work/gcc-13-20230226/gcc/cp/parser.cc:31912
next reply other threads:[~2023-02-28 17:09 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-02-28 17:09 asolokha at gmx dot com [this message] 2023-03-01 7:48 ` [Bug c++/108972] " rguenth at gcc dot gnu.org 2023-03-02 15:24 ` [Bug c++/108972] ICE: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in compare_lambda_template_head, at cp/lambda.cc:1551 since r13-3601-g2b0e81d5cc2f7e1d marxin at gcc dot gnu.org 2023-03-09 22:06 ` [Bug c++/108972] [13 Regression] " jason at gcc dot gnu.org 2023-03-10 18:49 ` cvs-commit at gcc dot gnu.org 2023-03-10 18:50 ` jason at gcc dot gnu.org 2023-03-14 15:19 ` cvs-commit at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-108972-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).