aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin v. Löwis <loewis@informatik.hu-berlin.de>1999-06-14 15:56:12 +0000
committerMartin v. Löwis <loewis@gcc.gnu.org>1999-06-14 15:56:12 +0000
commit92da7074dec9bcb615c1a9b1461d7207b7f6641e (patch)
tree5893efe1483030954993a35dda449713f012dfc8 /gcc
parentbf4f78eef9cd221aa66df893d5dd9e18c38f9eb2 (diff)
downloadgcc-92da7074dec9bcb615c1a9b1461d7207b7f6641e.zip
gcc-92da7074dec9bcb615c1a9b1461d7207b7f6641e.tar.gz
gcc-92da7074dec9bcb615c1a9b1461d7207b7f6641e.tar.bz2
pt.c (tsubst_friend_function): Push into namespace of friend function before pushdecl'ing it.
* pt.c (tsubst_friend_function): Push into namespace of friend function before pushdecl'ing it. From-SVN: r27520
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/pt.c7
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 18d83d8..99386f1 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+1999-06-14 Martin von Löwis <loewis@informatik.hu-berlin.de>
+
+ * pt.c (tsubst_friend_function): Push into namespace of friend
+ function before pushdecl'ing it.
+
1999-06-14 Nathan Sidwell <nathan@acm.org>
* call.c (build_new_op): Remove REF_BIND from all operands.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 2592ab4..712ad6c 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -4495,6 +4495,7 @@ tsubst_friend_function (decl, args)
tree old_decl;
tree new_friend_template_info;
tree new_friend_result_template_info;
+ tree ns;
int new_friend_is_defn;
/* We must save some information from NEW_FRIEND before calling
@@ -4517,7 +4518,13 @@ tsubst_friend_function (decl, args)
new_friend_result_template_info = NULL_TREE;
}
+ /* Inside pushdecl_namespace_level, we will push into the
+ current namespace. However, the friend function should
+ tyically go into the namespace of the template. */
+ ns = decl_namespace_context (new_friend);
+ push_nested_namespace (ns);
old_decl = pushdecl_namespace_level (new_friend);
+ pop_nested_namespace (ns);
if (old_decl != new_friend)
{