From 19d386202486248c7006d97f88786b75fb17b74f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Mon, 14 Jun 1999 16:13:10 +0000 Subject: [PATCH] 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: r27522 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/pt.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index dc79a5e925a0..6d7cd7848204 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +1999-06-14 Martin von Löwis + + * pt.c (tsubst_friend_function): Push into namespace of friend + function before pushdecl'ing it. + 1999-06-14 Nathan Sidwell * call.c (build_new_op): Remove REF_BIND from all operands. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index fbb2b1224fcc..26656dc96a9f 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -4476,6 +4476,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 @@ -4498,7 +4499,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) { -- 2.47.2