From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 385113858411; Wed, 1 Sep 2021 16:07:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 385113858411 From: "meinaccountnr2 at web dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/102161] New: Compiler crashes when taking the address of an enum Date: Wed, 01 Sep 2021 16:07:15 +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: 10.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: meinaccountnr2 at web dot de 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: Wed, 01 Sep 2021 16:07:16 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102161 Bug ID: 102161 Summary: Compiler crashes when taking the address of an enum Product: gcc Version: 10.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: meinaccountnr2 at web dot de Target Milestone: --- The compiler crashes on this code: template struct a {}; template struct b {}; struct s{ enum enu {a}; }; using T =3D b<{&s::enu}>; gcc 10.1 https://godbolt.org/z/r64EhbaGr gcc 10.2 https://godbolt.org/z/cT9PE9h4o gcc 10.3 https://godbolt.org/z/Y88jaEMrd gcc 11.1 https://godbolt.org/z/KfsEhqaM5 gcc 11.2 https://godbolt.org/z/T797EWoE5 gcc trunk https://godbolt.org/z/3Mdo67M64 gcc commit 2cc65fcbd470de8240f64317629a60fab879dfc5 stacktrace: /home/raphael/repos/cpp/source/gcc_kill_value_param_1.cpp:4:22: internal compiler error: in coerce_template_parms, at cp/pt.c:9060 4 | using T =3D b<{&s::enu}>; | ^ 0x68201a coerce_template_parms /home/raphael/repos/build-gcc/gcc/gcc/cp/pt.c:9060 0x831817 lookup_template_class_1 /home/raphael/repos/build-gcc/gcc/gcc/cp/pt.c:9843 0x832a6c lookup_template_class(tree_node*, tree_node*, tree_node*, tree_nod= e*, int, int) /home/raphael/repos/build-gcc/gcc/gcc/cp/pt.c:10230 0x8579cd finish_template_type(tree_node*, tree_node*, int) /home/raphael/repos/build-gcc/gcc/gcc/cp/semantics.c:3639 0x7f2f9f cp_parser_template_id /home/raphael/repos/build-gcc/gcc/gcc/cp/parser.c:18151 0x7f31eb cp_parser_class_name /home/raphael/repos/build-gcc/gcc/gcc/cp/parser.c:25463 0x7eb44a cp_parser_qualifying_entity /home/raphael/repos/build-gcc/gcc/gcc/cp/parser.c:7046 0x7eb44a cp_parser_nested_name_specifier_opt /home/raphael/repos/build-gcc/gcc/gcc/cp/parser.c:6728 0x8011c5 cp_parser_simple_type_specifier /home/raphael/repos/build-gcc/gcc/gcc/cp/parser.c:19561 0x7e028d cp_parser_type_specifier /home/raphael/repos/build-gcc/gcc/gcc/cp/parser.c:19220 0x7f0763 cp_parser_type_specifier_seq /home/raphael/repos/build-gcc/gcc/gcc/cp/parser.c:24125 0x7eeb34 cp_parser_type_id_1 /home/raphael/repos/build-gcc/gcc/gcc/cp/parser.c:23925 0x7f14b8 cp_parser_type_id /home/raphael/repos/build-gcc/gcc/gcc/cp/parser.c:24021 0x7f14b8 cp_parser_alias_declaration /home/raphael/repos/build-gcc/gcc/gcc/cp/parser.c:21551 0x80ec85 cp_parser_declaration /home/raphael/repos/build-gcc/gcc/gcc/cp/parser.c:14795 0x80f5dc cp_parser_toplevel_declaration /home/raphael/repos/build-gcc/gcc/gcc/cp/parser.c:14816 0x80f5dc cp_parser_translation_unit /home/raphael/repos/build-gcc/gcc/gcc/cp/parser.c:4978 0x80f5dc c_parse_file() /home/raphael/repos/build-gcc/gcc/gcc/cp/parser.c:46789 0x8e52fd c_common_parse_file() /home/raphael/repos/build-gcc/gcc/gcc/c-family/c-opts.c:1223=