From ff1ff960f5039cf1d2970bfe2ba965d1b994caf1 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Tue, 24 Oct 2017 19:01:03 +0000 Subject: re PR c++/82466 (Missing warning for re-declaration of built-in function as variable) 2017-10-24 Paolo Carlini PR c++/82466 * doc/invoke.texi ([Wbuiltin-declaration-mismatch]): Extend description. /cp 2017-10-24 Paolo Carlini 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. /c 2017-10-24 Paolo Carlini PR c++/82466 * c-decl.c (diagnose_mismatched_decls): Use OPT_Wbuiltin_declaration_mismatch. /testsuite 2017-10-24 Paolo Carlini 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. From-SVN: r254057 --- gcc/c/ChangeLog | 6 ++++++ gcc/c/c-decl.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'gcc/c') diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 1f697f1..c260f62 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,9 @@ +2017-10-24 Paolo Carlini + + PR c++/82466 + * c-decl.c (diagnose_mismatched_decls): Use + OPT_Wbuiltin_declaration_mismatch. + 2017-10-12 David Malcolm * c-parser.c (c_parser_require): Add "type_is_unique" param and diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index 26b34ab..5c472e6 100644 --- a/gcc/c/c-decl.c +++ b/gcc/c/c-decl.c @@ -1837,7 +1837,8 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, 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 " -- cgit v1.1