+2017-10-24 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/82466
+ * doc/invoke.texi ([Wbuiltin-declaration-mismatch]): Extend
+ description.
+
2017-10-24 Wilco Dijkstra <wdijkstr@arm.com>
PR rtl-optimization/82396
* tree-outof-ssa.h (always_initialized_rtx_for_ssa_name_p): Delete.
* expr.c (expand_expr_real_1) <expand_decl_rtl>: Revert latest change.
* loop-iv.c (iv_get_reaching_def): Likewise.
- * cfgexpand.c (expand_one_ssa_partition): Initialize the RTX if the
+ * cfgexpand.c (expand_one_ssa_partition): Initialize the RTX if the
variable is promoted and the partition contains undefined values.
2017-10-23 Sandra Loosemore <sandra@codesourcery.com>
(nios2_symbolic_constant_allowed): New.
(nios2_symbolic_constant_p): New.
(nios2_plus_symbolic_constant_p): New.
- (nios2_valid_addr_expr_p): Recognize addresses involving
+ (nios2_valid_addr_expr_p): Recognize addresses involving
symbolic constants.
(nios2_legitimate_address_p): Likewise, also LO_SUM.
(nios2_symbolic_memory_operand_p): New.
* i386.h (processor_costs): Remove sse_move; add xmm_move, ymm_move
and zmm_move. Increase size of sse load and store tables;
add unaligned load and store tables; add ssemmx_to_integer.
- * x86-tune-costs.h: Update all entries according to real
+ * x86-tune-costs.h: Update all entries according to real
move latencies from Agner Fog's manual and chip documentation.
2017-10-23 Jakub Jelinek <jakub@redhat.com>
+2017-10-24 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/82466
+ * c-decl.c (diagnose_mismatched_decls): Use
+ OPT_Wbuiltin_declaration_mismatch.
+
2017-10-12 David Malcolm <dmalcolm@redhat.com>
* c-parser.c (c_parser_require): Add "type_is_unique" param and
locate_old_decl (olddecl);
}
else if (TREE_PUBLIC (newdecl))
- warning (0, "built-in function %q+D declared as non-function",
+ warning (OPT_Wbuiltin_declaration_mismatch,
+ "built-in function %q+D declared as non-function",
newdecl);
else
warning (OPT_Wshadow, "declaration of %q+D shadows "
+2017-10-24 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/82466
+ * decl.c (duplicate_decls): Warn for built-in functions declared as
+ non-function, use OPT_Wbuiltin_declaration_mismatch.
+
+ * decl.c (duplicate_decls): Avoid redundant '+' in warning_at.
+
2017-10-24 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/80991
/* Avoid warnings redeclaring built-ins which have not been
explicitly declared. */
if (DECL_ANTICIPATED (olddecl))
- return NULL_TREE;
+ {
+ if (TREE_PUBLIC (newdecl)
+ && CP_DECL_CONTEXT (newdecl) == global_namespace)
+ warning_at (DECL_SOURCE_LOCATION (newdecl),
+ OPT_Wbuiltin_declaration_mismatch,
+ "built-in function %qD declared as non-function",
+ newdecl);
+ return NULL_TREE;
+ }
/* If you declare a built-in or predefined function name as static,
the old definition is overridden, but optionally warn this was a
warning_at (DECL_SOURCE_LOCATION (newdecl),
OPT_Wbuiltin_declaration_mismatch,
- "declaration of %q+#D conflicts with built-in "
+ "declaration of %q#D conflicts with built-in "
"declaration %q#D", newdecl, olddecl);
}
else if ((DECL_EXTERN_C_P (newdecl)
@item -Wno-builtin-declaration-mismatch
@opindex Wno-builtin-declaration-mismatch
@opindex Wbuiltin-declaration-mismatch
-Warn if a built-in function is declared with the wrong signature.
+Warn if a built-in function is declared with the wrong signature or
+as non-function.
This warning is enabled by default.
@item -Wno-builtin-macro-redefined
+2017-10-24 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/82466
+ * c-c++-common/Wbuiltin-declaration-mismatch-1.c: New.
+ * c-c++-common/Wno-builtin-declaration-mismatch-1.c: Likewise.
+ * g++.dg/warn/Wbuiltin_declaration_mismatch-1.C: Likewise.
+ * g++.dg/parse/builtin2.C: Adjust.
+ * g++.old-deja/g++.mike/p811.C: Likewise.
+
2017-10-24 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/80991
--- /dev/null
+/* PR c++/82466 */
+/* { dg-options "-Wbuiltin-declaration-mismatch" } */
+
+int printf; /* { dg-warning "declared as non-function" } */
--- /dev/null
+/* PR c++/82466 */
+/* { dg-options "-Wno-builtin-declaration-mismatch" } */
+
+int printf;
// PR c++/14432
-// { dg-options "" }
+// { dg-options "-Wno-builtin-declaration-mismatch" }
struct Y {};
Y y1;
--- /dev/null
+// PR c++/82466
+// { dg-options "-Wbuiltin-declaration-mismatch" }
+
+namespace N
+{
+ int printf;
+}
// { dg-do assemble }
-// { dg-options "" }
+// { dg-options "-Wno-builtin-declaration-mismatch" }
// This test case caused the compiler to abort at one point in time.
// prms-id: 811