aboutsummaryrefslogtreecommitdiff
path: root/gcc/diagnostic.c
diff options
context:
space:
mode:
authormanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2015-08-11 13:34:00 +0000
committermanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2015-08-11 13:34:00 +0000
commit0a489f51bbdba85dc3a73721a5933336807ca9bf (patch)
treea12c2f52d788ca60fdf10a283f4349676f1fe125 /gcc/diagnostic.c
parent6e3557fbc3cc33c95733c036386ee46dd70818c5 (diff)
gcc/ChangeLog:
2015-08-11 Manuel López-Ibáñez <manu@gcc.gnu.org> PR c/66098 PR c/66711 * diagnostic.c (diagnostic_classify_diagnostic): Take -Werror into account when deciding what was the command-line status. gcc/testsuite/ChangeLog: 2015-08-11 Manuel López-Ibáñez <manu@gcc.gnu.org> PR c/66098 PR c/66711 * gcc.dg/pragma-diag-3.c: New test. * gcc.dg/pragma-diag-4.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@226780 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r--gcc/diagnostic.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index fb9d1fbfd1b..01a8e35d73b 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -696,9 +696,10 @@ diagnostic_classify_diagnostic (diagnostic_context *context,
/* Record the command-line status, so we can reset it back on DK_POP. */
if (old_kind == DK_UNSPECIFIED)
{
- old_kind = context->option_enabled (option_index,
- context->option_state)
- ? DK_WARNING : DK_IGNORED;
+ old_kind = !context->option_enabled (option_index,
+ context->option_state)
+ ? DK_IGNORED : (context->warning_as_error_requested
+ ? DK_ERROR : DK_WARNING);
context->classify_diagnostic[option_index] = old_kind;
}