This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PING] Re: [PATCH] c/66516 - missing diagnostic on taking the address of a builtin function


On 09/01/2015 06:25 PM, Martin Sebor wrote:
Having now made this change, I don't think the added complexity
of three declarations and two trivial definitions of the new
c_decl_implicit function across five files is an improvement,

Three declarations?  Isn't declaring it in c-common.h enough?

especially since we're still checking for c_dialect_cxx().
(The change simply replaces:

   && (c_dialect_cxx () || !DECL_LANG_FLAG_2 (expr))

with

   && (c_dialect_cxx () || c_decl_implicit (expr))

as suggested.)

Seems like you can do without the check for C++ if you're defining this function for C++ (to just return false).

I agree with Joseph that the function is better.

+		 bool diag /* = true */)

Let's call these parameters "reject_builtin" rather than the generic "diag".

+    function = decay_conversion (function, complain, false);

Please add a comment to "false", e.g. /*reject_builtin*/false

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]