]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
pt.c (check_default_tmpl_args): Handle friends defined in the class just like member...
authorMark Mitchell <mark@codesourcery.com>
Thu, 15 Jul 1999 02:05:36 +0000 (02:05 +0000)
committerJeff Law <law@gcc.gnu.org>
Thu, 15 Jul 1999 02:05:36 +0000 (20:05 -0600)
        * pt.c (check_default_tmpl_args): Handle friends defined in the
        class just like member functions defined in the class.

From-SVN: r28111

gcc/cp/ChangeLog
gcc/cp/pt.c

index 12d6a48d42e953ba2e9a2c1a6d9c0f1b6faca97a..73a996c52e559d4078f4b86c57aa1308540f9c18 100644 (file)
@@ -1,3 +1,8 @@
+1999-07-15  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.
+
 Thu Jul 15 01:26:49 1999  H.J. Lu  <hjl@gnu.org>
 
        * decl.c (duplicate_decls): Relax restriction for exception
index fbb2b1224fcc21bcd8b73eb79b797a6a8d99deea..e1860ed719e47c0378e49f94ecbae52e424f5245 100644 (file)
@@ -2210,12 +2210,17 @@ check_default_tmpl_args (decl, parms, is_primary, is_partial)
 
   if (current_class_type
       && !TYPE_BEING_DEFINED (current_class_type)
-      && DECL_REAL_CONTEXT (decl) == current_class_type
       && 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
-       declared, so there's no need to do it again now.  This is an
-       inline member function definition.  */
+       declared, so there's no need to do it again now.  This function
+       was defined in class scope, but we're processing it's body now
+       that the class is complete.  */
     return;
 
   if (TREE_CODE (decl) != TYPE_DECL || is_partial || !is_primary)