OSDN Git Service

Fixup whitespace a litte
[pf3gnuchains/gcc-fork.git] / gcc / cp / decl.c
index 35dc38c..21ef001 100644 (file)
@@ -8718,7 +8718,7 @@ copy_fn_p (tree d)
 
 void grok_special_member_properties (tree decl)
 {
-  if (!DECL_NONSTATIC_MEMBER_FUNCTION_P(decl))
+  if (!DECL_NONSTATIC_MEMBER_FUNCTION_P (decl))
     ; /* Not special.  */
   else if (DECL_CONSTRUCTOR_P (decl))
     {
@@ -8828,13 +8828,15 @@ grok_op_properties (tree decl, bool complain)
   tree name = DECL_NAME (decl);
   enum tree_code operator_code;
   int arity;
+  bool ellipsis_p;
   tree class_type;
 
-  /* Count the number of arguments.  */
+  /* Count the number of arguments and check for ellipsis.  */
   for (argtype = argtypes, arity = 0;
        argtype && argtype != void_list_node;
        argtype = TREE_CHAIN (argtype))
     ++arity;
+  ellipsis_p = !argtype;
 
   class_type = DECL_CONTEXT (decl);
   if (class_type && !CLASS_TYPE_P (class_type))
@@ -9000,11 +9002,14 @@ grok_op_properties (tree decl, bool complain)
                     "conversion operator",
                     ref ? "a reference to " : "", what);
        }
+
       if (operator_code == COND_EXPR)
        {
          /* 13.4.0.3 */
          error ("ISO C++ prohibits overloading operator ?:");
        }
+      else if (ellipsis_p)
+       error ("%qD must not have variable number of arguments", decl);
       else if (ambi_op_p (operator_code))
        {
          if (arity == 1)
@@ -11026,7 +11031,7 @@ start_method (cp_decl_specifier_seq *declspecs,
   if (DECL_IN_AGGR_P (fndecl))
     {
       if (DECL_CONTEXT (fndecl)
-         && TREE_CODEDECL_CONTEXT (fndecl)) != NAMESPACE_DECL)
+         && TREE_CODE (DECL_CONTEXT (fndecl)) != NAMESPACE_DECL)
        error ("%qD is already defined in class %qT", fndecl,
               DECL_CONTEXT (fndecl));
       return error_mark_node;