aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/typeck.c
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely.gcc@gmail.com>2008-06-21 10:36:27 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2008-06-21 11:36:27 +0100
commit37ec60ed2c973aa38044e19e3d16b5fa1e5c0a6b (patch)
treecb7e944c3d3117169e18ab65ba86da1ea5ad04f8 /gcc/cp/typeck.c
parent6c813b1005d86bcfc33a4dfdf12cadf425191a30 (diff)
downloadgcc-37ec60ed2c973aa38044e19e3d16b5fa1e5c0a6b.zip
gcc-37ec60ed2c973aa38044e19e3d16b5fa1e5c0a6b.tar.gz
gcc-37ec60ed2c973aa38044e19e3d16b5fa1e5c0a6b.tar.bz2
typeck.c (composite_pointer_type_r, [...]): Change pedwarn to permerror.
* typeck.c (composite_pointer_type_r, cxx_sizeof_expr, cxx_alignof_expr, check_template_keyword, cp_build_binary_op, pointer_diff, cp_build_unary_op, build_x_compound_expr_from_list, build_reinterpret_cast_1, cp_build_c_cast, check_return_expr): Change pedwarn to permerror. * init.c (perform_member_init, build_new_1, build_new): Likewise. * decl.c (warn_extern_redeclared_static, duplicate_decls, * identify_goto, check_previous_goto_1, check_goto, define_label, check_tag_decl, start_decl, check_class_member_definition_namespace, grokfndecl, grokdeclarator): Likewise. * except.c (check_handlers): Likewise. * typeck2.c (digest_init): Likewise. * pt.c (check_specialization_namespace, check_explicit_instantiation_namespace, maybe_process_partial_specialization, check_explicit_specialization, convert_template_argument, do_decl_instantiation, do_type_instantiation, instantiate_decl): Likewise. * semantics.c (finish_template_type_parm): Likewise. * name-lookup.c (pushdecl_maybe_friend, check_for_out_of_scope_variable): Likewise. * decl2.c (finish_static_data_member_decl, build_anon_union_vars, coerce_new_type): Likewise. * parser.c (cp_parser_nested_name_specifier_opt, cp_parser_mem_initializer, cp_parser_elaborated_type_specifier, cp_parser_class_head, cp_parser_check_class_key): Likewise. (cp_parser_parameter_declaration): Check flag_permissive instead of flag_pedantic_errors. * call.c (joust): Change pedwarn to warning. * friend.c (make_friend_class): Likewise. From-SVN: r136999
Diffstat (limited to 'gcc/cp/typeck.c')
-rw-r--r--gcc/cp/typeck.c98
1 files changed, 49 insertions, 49 deletions
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 026e446..8fd3be2 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -435,9 +435,9 @@ composite_pointer_type_r (tree t1, tree t2, const char* location,
else
{
if (complain & tf_error)
- pedwarn ("%s between distinct pointer types %qT and %qT "
- "lacks a cast",
- location, t1, t2);
+ permerror ("%s between distinct pointer types %qT and %qT "
+ "lacks a cast",
+ location, t1, t2);
result_type = void_type_node;
}
result_type = cp_build_qualified_type (result_type,
@@ -450,9 +450,9 @@ composite_pointer_type_r (tree t1, tree t2, const char* location,
if (!same_type_p (TYPE_PTRMEM_CLASS_TYPE (t1),
TYPE_PTRMEM_CLASS_TYPE (t2))
&& (complain & tf_error))
- pedwarn ("%s between distinct pointer types %qT and %qT "
- "lacks a cast",
- location, t1, t2);
+ permerror ("%s between distinct pointer types %qT and %qT "
+ "lacks a cast",
+ location, t1, t2);
result_type = build_ptrmem_type (TYPE_PTRMEM_CLASS_TYPE (t1),
result_type);
}
@@ -1355,8 +1355,8 @@ cxx_sizeof_expr (tree e, tsubst_flags_t complain)
else if (is_overloaded_fn (e))
{
if (complain & tf_error)
- pedwarn ("ISO C++ forbids applying %<sizeof%> to an expression of "
- "function type");
+ permerror ("ISO C++ forbids applying %<sizeof%> to an expression of "
+ "function type");
else
return error_mark_node;
e = char_type_node;
@@ -1415,8 +1415,8 @@ cxx_alignof_expr (tree e, tsubst_flags_t complain)
else if (is_overloaded_fn (e))
{
if (complain & tf_error)
- pedwarn ("ISO C++ forbids applying %<__alignof%> to an expression of "
- "function type");
+ permerror ("ISO C++ forbids applying %<__alignof%> to an expression of "
+ "function type");
else
return error_mark_node;
if (TREE_CODE (e) == FUNCTION_DECL)
@@ -2146,7 +2146,7 @@ check_template_keyword (tree decl)
&& TREE_CODE (decl) != TEMPLATE_ID_EXPR)
{
if (!is_overloaded_fn (decl))
- pedwarn ("%qD is not a template", decl);
+ permerror ("%qD is not a template", decl);
else
{
tree fns;
@@ -2166,7 +2166,7 @@ check_template_keyword (tree decl)
fns = OVL_NEXT (fns);
}
if (!fns)
- pedwarn ("%qD is not a template", decl);
+ permerror ("%qD is not a template", decl);
}
}
}
@@ -3258,8 +3258,8 @@ cp_build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
if (t != error_mark_node)
{
if (complain & tf_error)
- pedwarn ("assuming cast to type %qT from overloaded function",
- TREE_TYPE (t));
+ permerror ("assuming cast to type %qT from overloaded function",
+ TREE_TYPE (t));
op0 = t;
}
}
@@ -3269,8 +3269,8 @@ cp_build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
if (t != error_mark_node)
{
if (complain & tf_error)
- pedwarn ("assuming cast to type %qT from overloaded function",
- TREE_TYPE (t));
+ permerror ("assuming cast to type %qT from overloaded function",
+ TREE_TYPE (t));
op1 = t;
}
}
@@ -3544,7 +3544,7 @@ cp_build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
{
result_type = type0;
if (complain & tf_error)
- pedwarn ("ISO C++ forbids comparison between pointer and integer");
+ permerror ("ISO C++ forbids comparison between pointer and integer");
else
return error_mark_node;
}
@@ -3552,7 +3552,7 @@ cp_build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
{
result_type = type1;
if (complain & tf_error)
- pedwarn ("ISO C++ forbids comparison between pointer and integer");
+ permerror ("ISO C++ forbids comparison between pointer and integer");
else
return error_mark_node;
}
@@ -3732,7 +3732,7 @@ cp_build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
{
result_type = type0;
if (complain & tf_error)
- pedwarn ("ISO C++ forbids comparison between pointer and integer");
+ permerror ("ISO C++ forbids comparison between pointer and integer");
else
return error_mark_node;
}
@@ -3740,7 +3740,7 @@ cp_build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
{
result_type = type1;
if (complain & tf_error)
- pedwarn ("ISO C++ forbids comparison between pointer and integer");
+ permerror ("ISO C++ forbids comparison between pointer and integer");
else
return error_mark_node;
}
@@ -4111,11 +4111,11 @@ pointer_diff (tree op0, tree op1, tree ptrtype)
if (pedantic || warn_pointer_arith)
{
if (TREE_CODE (target_type) == VOID_TYPE)
- pedwarn ("ISO C++ forbids using pointer of type %<void *%> in subtraction");
+ permerror ("ISO C++ forbids using pointer of type %<void *%> in subtraction");
if (TREE_CODE (target_type) == FUNCTION_TYPE)
- pedwarn ("ISO C++ forbids using pointer to a function in subtraction");
+ permerror ("ISO C++ forbids using pointer to a function in subtraction");
if (TREE_CODE (target_type) == METHOD_TYPE)
- pedwarn ("ISO C++ forbids using pointer to a method in subtraction");
+ permerror ("ISO C++ forbids using pointer to a method in subtraction");
}
/* First do the subtraction as integers;
@@ -4481,9 +4481,9 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert,
if (TREE_CODE (argtype) == ENUMERAL_TYPE)
{
if (complain & tf_error)
- pedwarn ((code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR)
- ? G_("ISO C++ forbids incrementing an enum")
- : G_("ISO C++ forbids decrementing an enum"));
+ permerror ((code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR)
+ ? G_("ISO C++ forbids incrementing an enum")
+ : G_("ISO C++ forbids decrementing an enum"));
else
return error_mark_node;
}
@@ -4509,11 +4509,11 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert,
&& !TYPE_PTROB_P (argtype))
{
if (complain & tf_error)
- pedwarn ((code == PREINCREMENT_EXPR
- || code == POSTINCREMENT_EXPR)
- ? G_("ISO C++ forbids incrementing a pointer of type %qT")
- : G_("ISO C++ forbids decrementing a pointer of type %qT"),
- argtype);
+ permerror ((code == PREINCREMENT_EXPR
+ || code == POSTINCREMENT_EXPR)
+ ? G_("ISO C++ forbids incrementing a pointer of type %qT")
+ : G_("ISO C++ forbids decrementing a pointer of type %qT"),
+ argtype);
else
return error_mark_node;
}
@@ -4570,7 +4570,7 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert,
{
/* ARM $3.4 */
if (complain & tf_error)
- pedwarn ("ISO C++ forbids taking address of function %<::main%>");
+ permerror ("ISO C++ forbids taking address of function %<::main%>");
else
return error_mark_node;
}
@@ -4631,15 +4631,15 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert,
else if (current_class_type
&& TREE_OPERAND (arg, 0) == current_class_ref)
/* An expression like &memfn. */
- pedwarn ("ISO C++ forbids taking the address of an unqualified"
- " or parenthesized non-static member function to form"
- " a pointer to member function. Say %<&%T::%D%>",
- base, name);
+ permerror ("ISO C++ forbids taking the address of an unqualified"
+ " or parenthesized non-static member function to form"
+ " a pointer to member function. Say %<&%T::%D%>",
+ base, name);
else
- pedwarn ("ISO C++ forbids taking the address of a bound member"
- " function to form a pointer to member function."
- " Say %<&%T::%D%>",
- base, name);
+ permerror ("ISO C++ forbids taking the address of a bound member"
+ " function to form a pointer to member function."
+ " Say %<&%T::%D%>",
+ base, name);
}
arg = build_offset_ref (base, fn, /*address_p=*/true);
}
@@ -4665,7 +4665,7 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert,
if (! lvalue_p (arg) && (pedantic || complain == tf_none))
{
if (complain & tf_error)
- pedwarn ("ISO C++ forbids taking the address of a cast to a non-lvalue expression");
+ permerror ("ISO C++ forbids taking the address of a cast to a non-lvalue expression");
else
return error_mark_node;
}
@@ -5010,7 +5010,7 @@ tree build_x_compound_expr_from_list (tree list, const char *msg)
if (TREE_CHAIN (list))
{
if (msg)
- pedwarn ("%s expression list treated as compound expression", msg);
+ permerror ("%s expression list treated as compound expression", msg);
for (list = TREE_CHAIN (list); list; list = TREE_CHAIN (list))
expr = build_x_compound_expr (expr, TREE_VALUE (list),
@@ -5561,8 +5561,8 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p,
if (TYPE_PRECISION (type) < TYPE_PRECISION (intype))
{
if (complain & tf_error)
- pedwarn ("cast from %qT to %qT loses precision",
- intype, type);
+ permerror ("cast from %qT to %qT loses precision",
+ intype, type);
else
return error_mark_node;
}
@@ -5838,7 +5838,7 @@ cp_build_c_cast (tree type, tree expr, tsubst_flags_t complain)
if (TREE_CODE (TREE_TYPE (expr)) == POINTER_TYPE)
{
if (complain & tf_error)
- pedwarn ("ISO C++ forbids casting to an array type %qT", type);
+ permerror ("ISO C++ forbids casting to an array type %qT", type);
else
return error_mark_node;
type = build_pointer_type (TREE_TYPE (type));
@@ -6964,8 +6964,8 @@ check_return_expr (tree retval, bool *no_warning)
that's supposed to return a value. */
if (!retval && fn_returns_value_p)
{
- pedwarn ("return-statement with no value, in function returning %qT",
- valtype);
+ permerror ("return-statement with no value, in function returning %qT",
+ valtype);
/* Clear this, so finish_function won't say that we reach the
end of a non-void function (which we don't, we gave a
return!). */
@@ -6985,8 +6985,8 @@ check_return_expr (tree retval, bool *no_warning)
its side-effects. */
finish_expr_stmt (retval);
else
- pedwarn ("return-statement with a value, in function "
- "returning 'void'");
+ permerror ("return-statement with a value, in function "
+ "returning 'void'");
current_function_returns_null = 1;