+2003-07-16 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/5421
+ * decl.c (grokdeclarator): Handle TEMPLATE_ID_EXPR if friend
+ is a member of other class.
+ * friend.c (do_friend): Don't build TEMPLATE_DECL if friend
+ is a specialization of function template.
+
2003-07-16 Gabriel Dos Reis <gdr@integrable-solutions.net>
PR c++/10903
members of other classes. */
/* All method decls are public, so tell grokfndecl to set
TREE_PUBLIC, also. */
- decl = grokfndecl (ctype, type, declarator, declarator,
+ decl = grokfndecl (ctype, type,
+ TREE_CODE (declarator) != TEMPLATE_ID_EXPR
+ ? declarator : dname,
+ declarator,
virtualp, flags, quals, raises,
friendp ? -1 : 0, friendp, 1, 0, funcdef_flag,
template_count, in_namespace);
if (is_friend_template)
decl = DECL_TI_TEMPLATE (push_template_decl (decl));
+ else if (DECL_TEMPLATE_INFO (decl))
+ ;
else if (template_class_depth (current_class_type))
decl = push_template_decl_real (decl, /*is_friend=*/1);
+2003-07-16 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/5421
+ * g++.dg/template/friend21.C: New test.
+
2003-07-16 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/cleanup-8.c: New test.
--- /dev/null
+// { dg-do compile }
+
+// Origin: ajl13@bellatlantic.net
+
+// PR c++/5421: ICE for specialization of member function template
+// as friend.
+
+struct B {
+ template <class T> void b();
+};
+
+template <class T> class A {
+ friend void B::b<T>();
+};
+
+static A<int> a;