From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F40ED3857004; Sat, 23 Jan 2021 12:24:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F40ED3857004 From: "dimitri.gorokhovik at free dot fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/98803] New: [C++20] ICE on invalid code with checked build [in synthesize_implicit_template_parm, at cp/parser.c:45335] Date: Sat, 23 Jan 2021 12:24:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dimitri.gorokhovik at free dot fr X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2021 12:24:01 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98803 Bug ID: 98803 Summary: [C++20] ICE on invalid code with checked build [in synthesize_implicit_template_parm, at cp/parser.c:45335] Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: dimitri.gorokhovik at free dot fr Target Milestone: --- Not sure whether ICEs from tree-check choking on error_mark should be submitted, but here is: template concept Defined =3D true; template struct entry {}; template constexpr auto matches (entry , Atom auto b) { return d =3D=3D b; }; compiling with 'g++ -std=3Dc++20' from 11.0.0 20210123 produces: bug-12.cpp:6:27: error: =E2=80=98Undefined=E2=80=99 has not been declared 6 | template | ^~~~~~~~~ bug-12.cpp:6:27: error: two or more data types in declaration of =E2=80=98u= =E2=80=99 bug-12.cpp:7:35: error: =E2=80=98u=E2=80=99 was not declared in this scope 7 | constexpr auto matches (entry , Atom auto b) { return d =3D= =3D b; }; | ^ bug-12.cpp:7:36: error: template argument 2 is invalid 7 | constexpr auto matches (entry , Atom auto b) { return d =3D= =3D b; }; | ^ bug-12.cpp:7:39: error: =E2=80=98Atom=E2=80=99 has not been declared 7 | constexpr auto matches (entry , Atom auto b) { return d =3D= =3D b; }; | ^~~~ bug-12.cpp:7:49: internal compiler error: tree check: expected tree that contains =E2=80=98decl common=E2=80=99 structure, have =E2=80=98error_mark= =E2=80=99 in synthesize_implicit_template_parm, at cp/parser.c:45335 7 | constexpr auto matches (entry , Atom auto b) { return d =3D= =3D b; }; | ^ 0x837a8f tree_contains_struct_check_failed(tree_node const*, tree_node_structure_enum, char const*, int, char const*) ../../src/gcc/tree.c:9986 0x6b0fa0 contains_struct_check(tree_node*, tree_node_structure_enum, char const*, int, char const*) ../../src/gcc/tree.h:3452 0x6b0fa0 synthesize_implicit_template_parm ../../src/gcc/cp/parser.c:45335 0xa94bad cp_parser_simple_type_specifier ../../src/gcc/cp/parser.c:18648 0xa7332d cp_parser_type_specifier ../../src/gcc/cp/parser.c:18457 0xa74329 cp_parser_decl_specifier_seq ../../src/gcc/cp/parser.c:15003 0xa8efce cp_parser_parameter_declaration ../../src/gcc/cp/parser.c:23693 0xa8f9a2 cp_parser_parameter_declaration_list ../../src/gcc/cp/parser.c:23510 0xa8fdf1 cp_parser_parameter_declaration_clause ../../src/gcc/cp/parser.c:23437 0xa80f33 cp_parser_direct_declarator ../../src/gcc/cp/parser.c:22086 0xa80f33 cp_parser_declarator ../../src/gcc/cp/parser.c:21949 0xa97f98 cp_parser_init_declarator ../../src/gcc/cp/parser.c:21447 0xa9edab cp_parser_single_declaration ../../src/gcc/cp/parser.c:30432 0xa9ef16 cp_parser_template_declaration_after_parameters ../../src/gcc/cp/parser.c:30004 0xa9f6c0 cp_parser_explicit_template_declaration ../../src/gcc/cp/parser.c:30270 0xaa1e09 cp_parser_declaration ../../src/gcc/cp/parser.c:14009 0xaa27ec cp_parser_toplevel_declaration ../../src/gcc/cp/parser.c:14107 0xaa27ec cp_parser_translation_unit ../../src/gcc/cp/parser.c:4936 0xaa27ec c_parse_file() ../../src/gcc/cp/parser.c:45170 0xbc538d c_common_parse_file() ../../src/gcc/c-family/c-opts.c:1211 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions.=