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))
{
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))
"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)
if (DECL_IN_AGGR_P (fndecl))
{
if (DECL_CONTEXT (fndecl)
- && TREE_CODE( DECL_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;