+2016-02-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR preprocessor/69543
+ PR c/69558
+ * c-pragma.c (handle_pragma_diagnostic): Pass input_location
+ instead of loc to control_warning_option.
+
2016-02-01 Nathan Sidwell <nathan@codesourcery.com>
* c.opt (fopenacc-dim=): New option.
const char *arg = NULL;
if (cl_options[option_index].flags & CL_JOINED)
arg = option_string + 1 + cl_options[option_index].opt_len;
+ /* FIXME: input_location isn't the best location here, but it is
+ what we used to do here before and changing it breaks e.g.
+ PR69543 and PR69558. */
control_warning_option (option_index, (int) kind,
arg, kind != DK_IGNORED,
- loc, lang_mask, &handlers,
+ input_location, lang_mask, &handlers,
&global_options, &global_options_set,
global_dc);
}
+2016-02-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR preprocessor/69543
+ PR c/69558
+ * gcc.dg/pr69543.c: New test.
+ * gcc.dg/pr69558.c: New test.
+
2016-02-01 Uros Bizjak <ubizjak@gmail.com>
PR testsuite/65940
--- /dev/null
+/* PR preprocessor/69543 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wuninitialized" } */
+
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
+ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
+ _Pragma ("GCC diagnostic pop")
+
+void test (char yylval)
+{
+ char *yyvsp;
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+ *++yyvsp = yylval;
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
+}
--- /dev/null
+/* PR c/69558 */
+/* { dg-do compile } */
+/* { dg-options "-Wdeprecated-declarations" } */
+
+#define A \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
+#define B \
+ _Pragma ("GCC diagnostic pop")
+#define C(x) \
+ A \
+ static inline void bar (void) { x (); } \
+ B
+
+__attribute__((deprecated)) void foo (void); /* { dg-bogus "declared here" } */
+
+C (foo) /* { dg-bogus "is deprecated" } */