diff options
author | Mark Mitchell <mmitchel@gcc.gnu.org> | 2005-11-19 02:25:55 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2005-11-19 02:25:55 +0000 |
commit | abc088aad79d47b40da8a26e87815db09ab2d6eb (patch) | |
tree | 8bd4a3b77c67b5c91f1aed77d26b1a55d7c5ba5d /gcc/cp/name-lookup.c | |
parent | 817f9ef2e52bbe4568264487acfa86c5bb2882d4 (diff) | |
download | gcc-abc088aad79d47b40da8a26e87815db09ab2d6eb.zip gcc-abc088aad79d47b40da8a26e87815db09ab2d6eb.tar.gz gcc-abc088aad79d47b40da8a26e87815db09ab2d6eb.tar.bz2 |
re PR c++/8355 (befriending a template specialization in another namespace)
PR c++/8355
* decl.c (grokfndecl): Set up DECL_TEMPLATE_INFO before calling
set_decl_namespace.
* name-lookup.c (set_decl_namespace):
PR c++/8355
* g++.dg/template/friend39.C: New test.
From-SVN: r107207
Diffstat (limited to 'gcc/cp/name-lookup.c')
-rw-r--r-- | gcc/cp/name-lookup.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 4302ca6..382a8a3a 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -2880,6 +2880,10 @@ set_decl_namespace (tree decl, tree scope, bool friendp) match. But, we'll check later, when we construct the template. */ return; + /* Instantiations or specializations of templates may be declared as + friends in any namespace. */ + if (friendp && DECL_USE_TEMPLATE (decl)) + return; if (is_overloaded_fn (old)) { for (; old; old = OVL_NEXT (old)) |