Commit 5937a6f9 by Mark Mitchell Committed by Mark Mitchell

pt.c (check_default_tmpl_args): Handle friends defined in the class just like…

pt.c (check_default_tmpl_args): Handle friends defined in the class just like member functions defined in the class.

	* pt.c (check_default_tmpl_args): Handle friends defined in the
	class just like member functions defined in the class.

From-SVN: r28097
parent 7e7b6c19
1999-07-14 Mark Mitchell <mark@codesourcery.com>
* pt.c (check_default_tmpl_args): Handle friends defined in the
class just like member functions defined in the class.
1999-07-09 Michael Tiemann <tiemann@happy.cygnus.com> 1999-07-09 Michael Tiemann <tiemann@happy.cygnus.com>
Jason Merrill <jason@yorick.cygnus.com> Jason Merrill <jason@yorick.cygnus.com>
......
...@@ -2211,12 +2211,17 @@ check_default_tmpl_args (decl, parms, is_primary, is_partial) ...@@ -2211,12 +2211,17 @@ check_default_tmpl_args (decl, parms, is_primary, is_partial)
if (current_class_type if (current_class_type
&& !TYPE_BEING_DEFINED (current_class_type) && !TYPE_BEING_DEFINED (current_class_type)
&& DECL_REAL_CONTEXT (decl) == current_class_type
&& DECL_LANG_SPECIFIC (decl) && DECL_LANG_SPECIFIC (decl)
&& DECL_DEFINED_IN_CLASS_P (decl)) /* If this is either a friend defined in the scope of the class
or a member function. */
&& DECL_CLASS_CONTEXT (decl) == current_class_type
/* And, if it was a member function, it really was defined in
the scope of the class. */
&& (!DECL_FUNCTION_MEMBER_P (decl) || DECL_DEFINED_IN_CLASS_P (decl)))
/* We already checked these parameters when the template was /* We already checked these parameters when the template was
declared, so there's no need to do it again now. This is an declared, so there's no need to do it again now. This function
inline member function definition. */ was defined in class scope, but we're processing it's body now
that the class is complete. */
return; return;
if (TREE_CODE (decl) != TYPE_DECL || is_partial || !is_primary) if (TREE_CODE (decl) != TYPE_DECL || is_partial || !is_primary)
......
// Build don't link:
// Origin: Mark Mitchell <mark@codesourcery.com>
template <class T = int>
struct S
{
void g ()
{
}
friend void f (double)
{
}
};
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