From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5A9C03858036; Wed, 6 Jan 2021 17:19:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5A9C03858036 From: "acoplan at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/98570] New: ICE: canonical types differ for identical types Date: Wed, 06 Jan 2021 17:19:27 +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: acoplan at gcc dot gnu.org 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, 06 Jan 2021 17:19:27 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98570 Bug ID: 98570 Summary: ICE: canonical types differ for identical types Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: acoplan at gcc dot gnu.org Target Milestone: --- GCC ICEs on the following (on at least aarch64 and x86). The testcase was reduced from polymake and is accepted by clang. template struct b { static constexpr int c =3D a; }; template struct h { typedef int d; }; template using f =3D typename h::d; namespace g { template using i =3D b; using j =3D long; } using g::i; using g::j; template using k =3D i<>; template f::c, j> m(); template f...>::c, j> m(); On AArch64, I can reproduce the ICE back to GCC 6. To reproduce: $ aarch64-elf-gcc -c testcase.ii testcase.ii:12:49: internal compiler error: canonical types differ for identical types 'h<(! g::i...>::c)>' and 'h<(! g::i::c)>' 12 | template f...>::c, j> m(); | ^ 0x9f85e5 comptypes(tree_node*, tree_node*, int) /home/alecop01/toolchain/src/gcc/gcc/cp/typeck.c:1543 0x9f9900 same_type_ignoring_top_level_qualifiers_p(tree_node*, tree_node*) /home/alecop01/toolchain/src/gcc/gcc/cp/typeck.c:1579 0x9f7827 structural_comptypes /home/alecop01/toolchain/src/gcc/gcc/cp/typeck.c:1423 0x9f8570 comptypes(tree_node*, tree_node*, int) /home/alecop01/toolchain/src/gcc/gcc/cp/typeck.c:1532 0x7b9309 decls_match(tree_node*, tree_node*, bool) /home/alecop01/toolchain/src/gcc/gcc/cp/decl.c:1026 0x7b983c decls_match(tree_node*, tree_node*, bool) /home/alecop01/toolchain/src/gcc/gcc/cp/decl.c:1080 0x7bacf8 duplicate_decls(tree_node*, tree_node*, bool, bool) /home/alecop01/toolchain/src/gcc/gcc/cp/decl.c:1459 0x8aed4d do_pushdecl /home/alecop01/toolchain/src/gcc/gcc/cp/name-lookup.c:3734 0x8b13cc do_pushdecl_with_scope /home/alecop01/toolchain/src/gcc/gcc/cp/name-lookup.c:4881 0x8b1533 pushdecl_namespace_level(tree_node*, bool) /home/alecop01/toolchain/src/gcc/gcc/cp/name-lookup.c:6245 0x97701e push_template_decl(tree_node*, bool) /home/alecop01/toolchain/src/gcc/gcc/cp/pt.c:6049 0x7d1839 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int, tree_node*, tree_node*, tree_node**) /home/alecop01/toolchain/src/gcc/gcc/cp/decl.c:5531 0x8fc85e cp_parser_init_declarator /home/alecop01/toolchain/src/gcc/gcc/cp/parser.c:21659 0x8ff1fb cp_parser_single_declaration /home/alecop01/toolchain/src/gcc/gcc/cp/parser.c:30427 0x8ff2f8 cp_parser_template_declaration_after_parameters /home/alecop01/toolchain/src/gcc/gcc/cp/parser.c:29999 0x8ffc2d cp_parser_explicit_template_declaration /home/alecop01/toolchain/src/gcc/gcc/cp/parser.c:30265 0x8ffc2d cp_parser_template_declaration_after_export /home/alecop01/toolchain/src/gcc/gcc/cp/parser.c:30284 0x90026a cp_parser_template_declaration /home/alecop01/toolchain/src/gcc/gcc/cp/parser.c:16533 0x909dcd cp_parser_declaration /home/alecop01/toolchain/src/gcc/gcc/cp/parser.c:14009 0x908f3b cp_parser_toplevel_declaration /home/alecop01/toolchain/src/gcc/gcc/cp/parser.c:14107 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions.=