summaryrefslogtreecommitdiff
path: root/gcc/diagnostic.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2013-03-21 17:36:47 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2013-03-21 17:36:47 +0000
commitd9d1b0a4878ce9d0e469ba5dfea170214c7c2023 (patch)
treee5e6b0ddf9668c7b20ff0d85dbd749ba6244b7e9 /gcc/diagnostic.c
parent2c8b23a2f0cdeb6458dad943a0ba24b36b427dd6 (diff)
downloadgcc-d9d1b0a4878ce9d0e469ba5dfea170214c7c2023.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196887 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r--gcc/diagnostic.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index a365c608a91..87eb8dc40ab 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -729,7 +729,10 @@ diagnostic_report_diagnostic (diagnostic_context *context,
diagnostic->message.format_spec,
diagnostic->message.args_ptr);
}
- ++diagnostic_kind_count (context, diagnostic->kind);
+ if (diagnostic->kind == DK_ERROR && orig_diag_kind == DK_WARNING)
+ ++diagnostic_kind_count (context, DK_WERROR);
+ else
+ ++diagnostic_kind_count (context, diagnostic->kind);
saved_format_spec = diagnostic->message.format_spec;
if (context->show_option_requested)