aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1998-05-20 23:53:04 +0000
committerJason Merrill <jason@gcc.gnu.org>1998-05-20 19:53:04 -0400
commitf9d94ea4d411ebc87081197daa8b53c65e50c6bd (patch)
tree36cf0562e2a9256de61a225af0e201604f64f713 /gcc
parent35acd3f28278072c4753f582ecdc1d49935b1d25 (diff)
downloadgcc-f9d94ea4d411ebc87081197daa8b53c65e50c6bd.zip
gcc-f9d94ea4d411ebc87081197daa8b53c65e50c6bd.tar.gz
gcc-f9d94ea4d411ebc87081197daa8b53c65e50c6bd.tar.bz2
decl.c (grokfndecl): Handle definition of specialization in friend declaration.
* decl.c (grokfndecl): Handle definition of specialization in friend declaration. * error.c (dump_decl): Fix LOOKUP_EXPR handling. From-SVN: r19919
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/decl.c27
-rw-r--r--gcc/cp/error.c2
3 files changed, 25 insertions, 11 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 4d991fd..6353d8d 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+1998-05-20 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl.c (grokfndecl): Handle definition of specialization in
+ friend declaration.
+
+ * error.c (dump_decl): Fix LOOKUP_EXPR handling.
+
1998-05-20 Mark Mitchell <mmitchell@usa.net>
* class.c (delete_duplicate_fields_1): Use DECL_DECLARES_TYPE_P
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 94de1da..a4f9e00 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -7625,16 +7625,23 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
break;
}
- if (friendp &&
- TREE_CODE (orig_declarator) == TEMPLATE_ID_EXPR)
- {
- /* A friend declaration of the form friend void f<>(). Record
- the information in the TEMPLATE_ID_EXPR. */
- SET_DECL_IMPLICIT_INSTANTIATION (decl);
- DECL_TEMPLATE_INFO (decl)
- = perm_tree_cons (TREE_OPERAND (orig_declarator, 0),
- TREE_OPERAND (orig_declarator, 1),
- NULL_TREE);
+ if (friendp
+ && TREE_CODE (orig_declarator) == TEMPLATE_ID_EXPR)
+ {
+ if (funcdef_flag)
+ cp_error
+ ("defining explicit specialization `%D' in friend declaration",
+ orig_declarator);
+ else
+ {
+ /* A friend declaration of the form friend void f<>(). Record
+ the information in the TEMPLATE_ID_EXPR. */
+ SET_DECL_IMPLICIT_INSTANTIATION (decl);
+ DECL_TEMPLATE_INFO (decl)
+ = perm_tree_cons (TREE_OPERAND (orig_declarator, 0),
+ TREE_OPERAND (orig_declarator, 1),
+ NULL_TREE);
+ }
}
/* Caller will do the rest of this. */
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 0c72619..c754819 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -872,7 +872,7 @@ dump_decl (t, v)
break;
case LOOKUP_EXPR:
- OB_PUTID (TREE_OPERAND (t, 0));
+ dump_decl (TREE_OPERAND (t, 0), v);
break;
case LABEL_DECL: