diff options
author | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2008-03-02 15:45:29 +0000 |
---|---|---|
committer | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2008-03-02 15:45:29 +0000 |
commit | 393eda6a41b2b2319868f41a754148bf037f955e (patch) | |
tree | fe322a3045cc0749a70363f868657cbec06018f4 /gcc/cp/cvt.c | |
parent | 92331508a65e169b0eeb2928312a3394cefe0278 (diff) | |
download | gcc-393eda6a41b2b2319868f41a754148bf037f955e.zip gcc-393eda6a41b2b2319868f41a754148bf037f955e.tar.gz gcc-393eda6a41b2b2319868f41a754148bf037f955e.tar.bz2 |
re PR c++/24924 (front end and preprocessor pedantic_errors settings should agree)
2008-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR 24924
* c-common.c (flag_permissive): Delete.
(constant_expression_warnings): Check flags first.
(constant_expression_error): New.
* c-common.h (flag_permissive): Delete.
(constant_expression_error): Declare.
* flags.h (flag_permissive): Declare. Update description.
* diagnostic.c (pedwarn): Update.
(permerror): New.
* diagnostic.h: (pedantic_error_kind): Rename as pedantic_warning_kind.
(permissive_error_kind): New.
* toplev.c (flag_permissive): Define. Update description.
* toplev.h (permissive_error_kind): Declare.
* c-errors.c (pedwarn_c99): Use pedantic_warning_kind.
(pedwarn_c90): Use pedantic_warning_kind.
* c-opts.c (c_common_post_options): flag_permissive does not affect
flag_pedantic_errors.
cp/
* class.c (finish_struct_anon): Use permerror instead of pedwarn.
(check_field_decls): Likewise.
(note_name_declared_in_class): Likewise.
* call.c (build_new_op): Likewise.
(convert_like_real): Likewise.
(build_over_call): Likewise.
* lex.c (unqualified_fn_lookup_error): Likewise.
* parser.c (cp_parser_template_id): Likewise.
* cvt.c (warn_ref_binding): Likewise.
(convert_to_reference): Likewise.
(ocp_convert): Likewise.
(convert_to_void): Use error instead of pedwarn.
* error.c (cp_cpp_error): Use pedantic_warning_kind.
* decl.c (compute_array_index_type): Use constant_expression_error.
testsuite/
* g++.dg/cpp/string-2.C: This is a warning now.
* g++.dg/cpp/pedantic-errors.C: -pedantic-errors is not enabled by
default, so add it.
From-SVN: r132817
Diffstat (limited to 'gcc/cp/cvt.c')
-rw-r--r-- | gcc/cp/cvt.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index a75036f..ee5759d 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -379,7 +379,7 @@ warn_ref_binding (tree reftype, tree intype, tree decl) msg = "conversion to non-const reference type %q#T from" " rvalue of type %qT"; - pedwarn (msg, reftype, intype); + permerror (msg, reftype, intype); } } @@ -449,8 +449,8 @@ convert_to_reference (tree reftype, tree expr, int convtype, if (! (convtype & CONV_CONST) && !at_least_as_qualified_p (ttl, ttr)) - pedwarn ("conversion from %qT to %qT discards qualifiers", - ttr, reftype); + permerror ("conversion from %qT to %qT discards qualifiers", + ttr, reftype); } return build_up_reference (reftype, expr, flags, decl); @@ -646,9 +646,9 @@ ocp_convert (tree type, tree expr, int convtype, int flags) || TREE_CODE (intype) == POINTER_TYPE)) { if (flags & LOOKUP_COMPLAIN) - pedwarn ("conversion from %q#T to %q#T", intype, type); + permerror ("conversion from %q#T to %q#T", intype, type); - if (flag_pedantic_errors) + if (!flag_permissive) return error_mark_node; } if (IS_AGGR_TYPE (intype)) @@ -892,8 +892,8 @@ convert_to_void (tree expr, const char *implicit) { /* [over.over] enumerates the places where we can take the address of an overloaded function, and this is not one of them. */ - pedwarn ("%s cannot resolve address of overloaded function", - implicit ? implicit : "void cast"); + error ("%s cannot resolve address of overloaded function", + implicit ? implicit : "void cast"); expr = void_zero_node; } else if (implicit && probe == expr && is_overloaded_fn (probe)) |