tree attributes;
tree result_type;
- if (TYPE_PTRFN_P (t2) && (complain & tf_error))
- {
- switch (operation)
- {
- case CPO_COMPARISON:
- pedwarn (input_location, OPT_Wpedantic,
- "ISO C++ forbids comparison between "
- "pointer of type %<void *%> and pointer-to-function");
- break;
- case CPO_CONVERSION:
- pedwarn (input_location, OPT_Wpedantic,
- "ISO C++ forbids conversion between "
- "pointer of type %<void *%> and pointer-to-function");
- break;
- case CPO_CONDITIONAL_EXPR:
- pedwarn (input_location, OPT_Wpedantic,
- "ISO C++ forbids conditional expression between "
- "pointer of type %<void *%> and pointer-to-function");
- break;
- default:
- gcc_unreachable ();
- }
+ if (TYPE_PTRFN_P (t2))
+ {
+ if (complain & tf_error)
+ {
+ switch (operation)
+ {
+ case CPO_COMPARISON:
+ pedwarn (input_location, OPT_Wpedantic,
+ "ISO C++ forbids comparison between pointer "
+ "of type %<void *%> and pointer-to-function");
+ break;
+ case CPO_CONVERSION:
+ pedwarn (input_location, OPT_Wpedantic,
+ "ISO C++ forbids conversion between pointer "
+ "of type %<void *%> and pointer-to-function");
+ break;
+ case CPO_CONDITIONAL_EXPR:
+ pedwarn (input_location, OPT_Wpedantic,
+ "ISO C++ forbids conditional expression between "
+ "pointer of type %<void *%> and "
+ "pointer-to-function");
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ }
+ else
+ return error_mark_node;
}
result_type
= cp_build_qualified_type (void_type_node,
pedwarn (input_location, OPT_Wpointer_arith,
"invalid application of %qs to a member function",
operator_name_info[(int) op].name);
+ else
+ return error_mark_node;
value = size_one_node;
}
if (cxx_dialect >= cxx1y && array_of_runtime_bound_p (type)
&& (flag_iso || warn_vla > 0))
{
- if (complain & tf_warning_or_error)
+ if (complain)
pedwarn (input_location, OPT_Wvla,
"taking sizeof array of runtime bound");
else
return error_mark_node;
}
- if (!lvalue_p (array) && (complain & tf_error))
- pedwarn (loc, OPT_Wpedantic,
- "ISO C++ forbids subscripting non-lvalue array");
+ if (!lvalue_p (array))
+ {
+ if (complain & tf_error)
+ pedwarn (loc, OPT_Wpedantic,
+ "ISO C++ forbids subscripting non-lvalue array");
+ else
+ return error_mark_node;
+ }
/* Note in C++ it is valid to subscript a `register' array, since
it is valid to take the address of something with that
fndecl = function;
/* Convert anything with function type to a pointer-to-function. */
- if (DECL_MAIN_P (function) && (complain & tf_error))
- pedwarn (input_location, OPT_Wpedantic,
- "ISO C++ forbids calling %<::main%> from within program");
-
+ if (DECL_MAIN_P (function))
+ {
+ if (complain & tf_error)
+ pedwarn (input_location, OPT_Wpedantic,
+ "ISO C++ forbids calling %<::main%> from within program");
+ else
+ return error_mark_node;
+ }
function = build_addr_func (function, complain);
}
else