https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82466

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Thanks. I don't think there is *much* more than the below to it:

Index: decl.c
===================================================================
--- decl.c      (revision 253509)
+++ decl.c      (working copy)
@@ -1431,7 +1431,13 @@
          /* Avoid warnings redeclaring built-ins which have not been
             explicitly declared.  */
          if (DECL_ANTICIPATED (olddecl))
-           return NULL_TREE;
+           {
+             if (TREE_PUBLIC (newdecl))
+               warning_at (DECL_SOURCE_LOCATION (newdecl),
+                           0, "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

however, with the warning unconditionally enabled, as in the C front-end,
g++.dg/parse/builtin2.C fails. Maybe that's ok, maybe we want to give the
warning a name. Bernd, are you willing to work on this issue too, for 8?

Reply via email to