+2014-04-30 Marek Polacek <polacek@redhat.com>
+
+ PR c/60139
+ * c-typeck.c (output_init_element): Pass OPT_Wpedantic to pedwarn
+ and pedwarn_init. Use loc insted of input_location.
+
2014-04-30 Marek Polacek <polacek@redhat.com>
PR c/60351
value = error_mark_node;
}
else if (require_constant_elements)
- pedwarn (input_location, 0,
+ pedwarn (loc, OPT_Wpedantic,
"initializer element is not computable at load time");
}
else if (!maybe_const
&& (require_constant_value || require_constant_elements))
- pedwarn_init (input_location, 0,
+ pedwarn_init (loc, OPT_Wpedantic,
"initializer element is not a constant expression");
/* Issue -Wc++-compat warnings about initializing a bitfield with
+2014-04-30 Marek Polacek <polacek@redhat.com>
+
+ PR c/60139
+ * gcc.dg/pr60139.c: New test.
+
2014-04-30 Marek Polacek <polacek@redhat.com>
PR c/60351
--- /dev/null
+/* PR c/60139 */
+/* { dg-do compile } */
+/* { dg-options "-Wpedantic" } */
+/* { dg-prune-output ".*near initialization for.*" } */
+
+double sin (double);
+void
+fn (int *p)
+{
+ int **a[] = { &p, /* { dg-warning "17:initializer element is not computable at load time" } */
+ (void *) 0, &p }; /* { dg-warning "28:initializer element is not computable at load time" } */
+ double d[] = { sin (1.0), /* { dg-warning "18:initializer element is not a constant expression" } */
+ 8.8, sin (1.0), 2.6 }; /* { dg-warning "23:initializer element is not a constant expression" } */
+}