diff options
author | Jakub Jelinek <jakub@redhat.com> | 2013-03-21 18:36:47 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2013-03-21 18:36:47 +0100 |
commit | 37e9911604ec069ee198879bb3a4af5d47b82a6b (patch) | |
tree | e5e6b0ddf9668c7b20ff0d85dbd749ba6244b7e9 /gcc/cp | |
parent | c845cfe1af6a72609e04a68b967f2b919599b32b (diff) | |
download | gcc-37e9911604ec069ee198879bb3a4af5d47b82a6b.zip gcc-37e9911604ec069ee198879bb3a4af5d47b82a6b.tar.gz gcc-37e9911604ec069ee198879bb3a4af5d47b82a6b.tar.bz2 |
re PR middle-end/48087 (-Wall -Werror adds warnings over and above those generated by -Wall)
PR middle-end/48087
* diagnostic.def (DK_WERROR): New kind.
* diagnostic.h (werrorcount): Define.
* diagnostic.c (diagnostic_report_diagnostic): For DK_WARNING
promoted to DK_ERROR, increment DK_WERROR counter instead of
DK_ERROR counter.
* toplev.c (toplev_main): Call print_ignored_options even if
just werrorcount is non-zero. Exit with FATAL_EXIT_CODE
even if just werrorcount is non-zero.
* pt.c (convert_nontype_argument): Count werrorcount as warnings.
* call.c (build_temp): Likewise.
* method.c (synthesize_method): Likewise.
* typeck.c (convert_for_initialization): Likewise.
From-SVN: r196887
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/cp/call.c | 4 | ||||
-rw-r--r-- | gcc/cp/method.c | 4 | ||||
-rw-r--r-- | gcc/cp/pt.c | 4 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 4 |
5 files changed, 16 insertions, 8 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 7c282e8..377528d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2013-03-21 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/48087 + * pt.c (convert_nontype_argument): Count werrorcount as warnings. + * call.c (build_temp): Likewise. + * method.c (synthesize_method): Likewise. + * typeck.c (convert_for_initialization): Likewise. + 2013-03-21 Marc Glisse <marc.glisse@inria.fr> * call.c (build_conditional_expr_1): Fold VEC_COND_EXPR. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 5c9c286..87fbb2e 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -5709,12 +5709,12 @@ build_temp (tree expr, tree type, int flags, int savew, savee; vec<tree, va_gc> *args; - savew = warningcount, savee = errorcount; + savew = warningcount + werrorcount, savee = errorcount; args = make_tree_vector_single (expr); expr = build_special_member_call (NULL_TREE, complete_ctor_identifier, &args, type, flags, complain); release_tree_vector (args); - if (warningcount > savew) + if (warningcount + werrorcount > savew) *diagnostic_kind = DK_WARNING; else if (errorcount > savee) *diagnostic_kind = DK_ERROR; diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 55c7e50..316c5d3 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -755,7 +755,7 @@ synthesize_method (tree fndecl) tree stmt; location_t save_input_location = input_location; int error_count = errorcount; - int warning_count = warningcount; + int warning_count = warningcount + werrorcount; /* Reset the source location, we might have been previously deferred, and thus have saved where we were first needed. */ @@ -817,7 +817,7 @@ synthesize_method (tree fndecl) pop_deferring_access_checks (); - if (error_count != errorcount || warning_count != warningcount) + if (error_count != errorcount || warning_count != warningcount + werrorcount) inform (input_location, "synthesized method %qD first required here ", fndecl); } diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index d56ffed..f815305 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -5601,12 +5601,12 @@ convert_nontype_argument (tree type, tree expr, tsubst_flags_t complain) { if (complain & tf_error) { - int errs = errorcount, warns = warningcount; + int errs = errorcount, warns = warningcount + werrorcount; if (processing_template_decl && !require_potential_constant_expression (expr)) return NULL_TREE; expr = cxx_constant_value (expr); - if (errorcount > errs || warningcount > warns) + if (errorcount > errs || warningcount + werrorcount > warns) inform (EXPR_LOC_OR_HERE (expr), "in template argument for type %qT ", type); if (expr == error_mark_node) diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 3ced858..c58b7b3 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -7977,11 +7977,11 @@ convert_for_initialization (tree exp, tree type, tree rhs, int flags, int savew = 0, savee = 0; if (fndecl) - savew = warningcount, savee = errorcount; + savew = warningcount + werrorcount, savee = errorcount; rhs = initialize_reference (type, rhs, flags, complain); if (fndecl) { - if (warningcount > savew) + if (warningcount + werrorcount > savew) warning (0, "in passing argument %P of %q+D", parmnum, fndecl); else if (errorcount > savee) error ("in passing argument %P of %q+D", parmnum, fndecl); |