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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-06-03
                 CC|                            |manu at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #2 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
This is my fault. When I fixed the handling of defaults in the command-line
(PR59304), I failed to handle the case of using -Werror.

This should fix it:

Index: diagnostic.c
===================================================================
--- diagnostic.c        (revision 223651)
+++ diagnostic.c        (working copy)
@@ -695,13 +695,14 @@ diagnostic_classify_diagnostic (diagnost
       int i;

       /* 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,
+         old_kind = !context->option_enabled (option_index,
                                              context->option_state)
-           ? DK_WARNING : DK_IGNORED;
+           ? DK_IGNORED : (context->warning_as_error_requested
+                           ? DK_ERROR: DK_WARNING);
          context->classify_diagnostic[option_index] = old_kind;
        }

       for (i = context->n_classification_history - 1; i >= 0; i --)
        if (context->classification_history[i].option == option_index)

Reply via email to