Commit c6f3ffc6 by Mark Mitchell Committed by Mark Mitchell

friend.c (do_friend): Don't resolve scopes when processing template declarations...

	* friend.c (do_friend): Don't resolve scopes when processing
	template declarations, even if the qualifying scope doesn't
	involve template parameters.

From-SVN: r31321
parent da36fb77
2000-01-11 Mark Mitchell <mark@codesourcery.com>
* friend.c (do_friend): Don't resolve scopes when processing
template declarations, even if the qualifying scope doesn't
involve template parameters.
2000-01-10 Mark Mitchell <mitchell@dumbledore.codesourcery.com>
* class.c (dfs_modify_vtables_queue_p): Remove.
......
/* Help friends in C++.
Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of GNU CC.
......@@ -402,7 +402,7 @@ do_friend (ctype, declarator, decl, parmdecls, attrlist,
/* We can't do lookup in a type that involves template
parameters. Instead, we rely on tsubst_friend_function
to check the validity of the declaration later. */
if (uses_template_parms (ctype))
if (processing_template_decl)
add_friend (current_class_type, decl);
/* A nested class may declare a member of an enclosing class
to be a friend, so we do lookup here even if CTYPE is in
......
// Build don't link:
// Origin: Matt Austern <austern@isolde.engr.sgi.com>
class A {
public:
static void f();
};
template <class T>
class B : public A {
friend void A::f();
};
template <class T>
class C : public B<T>
{
};
template class C<char>;
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