[Bug c++/68954] [5/6 Regression] -Wdeprecated-declarations -Werror errors for system header templates

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Dec 17 09:40:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68954

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Caused by (the backport of)

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.dg/pragma-diag-3.c: New test.
        * gcc.dg/pragma-diag-4.c: New test.

which just did

Index: gcc/diagnostic.c
===================================================================
--- gcc/diagnostic.c    (revision 226779)
+++ gcc/diagnostic.c    (revision 226780)
@@ -696,9 +696,10 @@ diagnostic_classify_diagnostic (diagnost
       /* 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;
        }

note I need -Werror=deprecated-declarations in GCC 5.2 to error about the
deprecated declaration use (the warning is enabled by default).


Note that a simple

> gcc-5.3 -Werror t.C

reproduces the issue (the error)


More information about the Gcc-bugs mailing list