From d9d1b0a4878ce9d0e469ba5dfea170214c7c2023 Mon Sep 17 00:00:00 2001 From: jakub Date: Thu, 21 Mar 2013 17:36:47 +0000 Subject: 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 --- gcc/diagnostic.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gcc/diagnostic.c') 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) -- cgit v1.2.1