Commit 963142fc by Mark Mitchell Committed by Mark Mitchell

decl2.c (arg_assoc_class): Correct check for namespace-scope friends.

	* cp/decl2.c (arg_assoc_class): Correct check for namespace-scope
	friends.
	* cp/pt.c (instantiate_class_template): Fix formatting.

	* g++.dg/template/friend17.C: New test.

From-SVN: r64645
parent f3cd0185
2003-03-20 Mark Mitchell <mark@codesourcery.com>
* cp/decl2.c (arg_assoc_class): Correct check for namespace-scope
friends.
* cp/pt.c (instantiate_class_template): Fix formatting.
2003-03-14 Matt Austern <austern@apple.com>
* cp-tree.h (unemitted_tinfo_decls): Declaration of a new varray.
......
......@@ -3963,7 +3963,7 @@ arg_assoc_class (struct arg_lookup *k, tree type)
friends = TREE_CHAIN (friends))
/* Only interested in global functions with potentially hidden
(i.e. unqualified) declarations. */
if (decl_namespace (TREE_VALUE (friends)) == context)
if (CP_DECL_CONTEXT (TREE_VALUE (friends)) == context)
if (add_function (k, TREE_VALUE (friends)))
return true;
......
......@@ -5548,12 +5548,8 @@ instantiate_class_template (type)
--processing_template_decl;
}
else
{
/* Build new DECL_FRIENDLIST. */
add_friend (type,
tsubst_friend_function (t, args));
}
/* Build new DECL_FRIENDLIST. */
add_friend (type, tsubst_friend_function (t, args));
}
}
......
2003-03-20 Mark Mitchell <mark@codesourcery.com>
* g++.dg/template/friend17.C: New test.
2003-03-21 Alan Modra <amodra@bigpond.net.au>
* gcc.c-torture/compile/20030320-1.c: New.
......
template <class T>
struct X {
template <class U> void operator+=(U);
template <class V>
template <class U>
friend void X<V>::operator+=(U);
};
int main() {
X<int>() += 1.0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment