diff options
author | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2015-08-11 13:34:00 +0000 |
---|---|---|
committer | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2015-08-11 13:34:00 +0000 |
commit | b32bc1ac16670eef2a0e61ae7bad47f8cfd278ed (patch) | |
tree | a12c2f52d788ca60fdf10a283f4349676f1fe125 /gcc/diagnostic.c | |
parent | 8299dd5cbb6fbb756f0ad2f4dbff31c549e00837 (diff) | |
download | gcc-b32bc1ac16670eef2a0e61ae7bad47f8cfd278ed.zip gcc-b32bc1ac16670eef2a0e61ae7bad47f8cfd278ed.tar.gz gcc-b32bc1ac16670eef2a0e61ae7bad47f8cfd278ed.tar.bz2 |
re PR c/66098 (#pragma diagnostic 'ignored' not fully undone by pop for strict-overflow)
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.
From-SVN: r226780
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r-- | gcc/diagnostic.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index fb9d1fbf..01a8e35 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; } |