* typeck.c (build_reinterpret_cast_1): Pass proper argument to
warn() in pedantic.
From-SVN: r209870
+2014-04-28 Daniel Gutson <daniel.gutson@tallertechnologies.com>
+
+ * typeck.c (build_reinterpret_cast_1): Pass proper argument to
+ warn() in pedantic.
+
2014-02-28 Jason Merrill <jason@redhat.com>
PR c++/58845
where possible, and it is necessary in some cases. DR 195
addresses this issue, but as of 2004/10/26 is still in
drafting. */
- warning (0, "ISO C++ forbids casting between pointer-to-function and pointer-to-object");
+ warning (OPT_Wpedantic, "ISO C++ forbids casting between pointer-to-function and pointer-to-object");
return fold_if_not_in_template (build_nop (type, expr));
}
else if (TREE_CODE (type) == VECTOR_TYPE)
--- /dev/null
+// { dg-do compile }
+// { dg-options "-pedantic" }
+typedef void F(void);
+
+void foo()
+{
+ void* p = 0;
+ F* f1 = reinterpret_cast<F*>(p); // { dg-warning "ISO" }
+#pragma GCC diagnostic ignored "-pedantic"
+ F* f2 = reinterpret_cast<F*>(p);
+}