diff options
author | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2014-08-20 12:48:16 +0000 |
---|---|---|
committer | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2014-08-20 12:48:16 +0000 |
commit | 3ba421e8becbd17526a88ec76226d7213b96af14 (patch) | |
tree | 3164cedfb7fb422a18eb3305ee3af6daa65943fa /gcc/opts-common.c | |
parent | c84d88e45c50cadf07edfaac07b174490d48bbde (diff) |
re PR c/59304 (#pragma diagnostic pop after warning fails for options unspecified in the command-line and disabled by default)
gcc/ChangeLog:
2014-08-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/59304
* opts-common.c (set_option): Call diagnostic_classify_diagnostic
before setting the option.
* diagnostic.c (diagnostic_classify_diagnostic): Record
command-line status.
gcc/testsuite/ChangeLog:
2014-08-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/59304
* gcc.dg/pr59304.c: New test.
From-SVN: r214221
Diffstat (limited to 'gcc/opts-common.c')
-rw-r--r-- | gcc/opts-common.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/opts-common.c b/gcc/opts-common.c index 007a546e388..3b942016183 100644 --- a/gcc/opts-common.c +++ b/gcc/opts-common.c @@ -1119,6 +1119,9 @@ set_option (struct gcc_options *opts, struct gcc_options *opts_set, if (!flag_var) return; + if ((diagnostic_t) kind != DK_UNSPECIFIED && dc != NULL) + diagnostic_classify_diagnostic (dc, opt_index, (diagnostic_t) kind, loc); + if (opts_set != NULL) set_flag_var = option_flag_var (opt_index, opts_set); @@ -1198,10 +1201,6 @@ set_option (struct gcc_options *opts, struct gcc_options *opts_set, } break; } - - if ((diagnostic_t) kind != DK_UNSPECIFIED - && dc != NULL) - diagnostic_classify_diagnostic (dc, opt_index, (diagnostic_t) kind, loc); } /* Return the address of the flag variable for option OPT_INDEX in |