http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56971
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |ice-on-valid-code Status|UNCONFIRMED |NEW Last reconfirmed| |2013-04-25 Summary|GCC claims a friend |[4.9 Regression] GCC claims |function to be overloaded, |a friend function to be |but it isn't |overloaded, but it isn't Ever Confirmed|0 |1 --- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-04-25 11:20:33 UTC --- ICE confirmed with trunk, which is a regression: ice.c: In instantiation of 'struct b<rp>': ice.c:16:11: required from here ice.c:8:17: internal compiler error: canonical types differ for identical types b<P> and b<FriendP> friend void f(b<FriendP> from); ^ 0x64861b comptypes ../../gcc-4.9/gcc/cp/typeck.c:1395 0x64861b comptypes ../../gcc-4.9/gcc/cp/typeck.c:1369 0x649b33 compparms(tree_node const*, tree_node const*) ../../gcc-4.9/gcc/cp/typeck.c:1501 0x54526b decls_match(tree_node*, tree_node*) ../../gcc-4.9/gcc/cp/decl.c:1026 0x545cc4 duplicate_decls(tree_node*, tree_node*, bool) ../../gcc-4.9/gcc/cp/decl.c:1241 0x6e9801 push_overloaded_decl_1 ../../gcc-4.9/gcc/cp/name-lookup.c:2288 0x6e9801 push_overloaded_decl ../../gcc-4.9/gcc/cp/name-lookup.c:2383 0x6eb1ed pushdecl_maybe_friend_1 ../../gcc-4.9/gcc/cp/name-lookup.c:885 0x6eb1ed pushdecl_maybe_friend(tree_node*, bool) ../../gcc-4.9/gcc/cp/name-lookup.c:1219 0x6eca79 pushdecl_with_scope_1 ../../gcc-4.9/gcc/cp/name-lookup.c:2206 0x6ed7ab pushdecl_with_scope(tree_node*, cp_binding_level*, bool) ../../gcc-4.9/gcc/cp/name-lookup.c:2220 0x6ed86d pushdecl_namespace_level(tree_node*, bool) ../../gcc-4.9/gcc/cp/name-lookup.c:3761 0x5b9e69 tsubst_friend_function ../../gcc-4.9/gcc/cp/pt.c:8137 0x5bb493 instantiate_class_template_1 ../../gcc-4.9/gcc/cp/pt.c:8997 0x5bb493 instantiate_class_template(tree_node*) ../../gcc-4.9/gcc/cp/pt.c:9081 0x6439bb complete_type ../../gcc-4.9/gcc/cp/typeck.c:131 0x6439bb complete_type ../../gcc-4.9/gcc/cp/typeck.c:105 0x534f27 start_decl_1(tree_node*, bool) ../../gcc-4.9/gcc/cp/decl.c:4666 0x558990 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int, tree_node*, tree_node*, tree_node**) ../../gcc-4.9/gcc/cp/decl.c:4629 0x618430 cp_parser_init_declarator ../../gcc-4.9/gcc/cp/parser.c:16138 4.6, 4.7 and 4.8 reject it, which is better than an ICE but possibly still wrong.