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: [C++ Patch] Mini bunch of mini clean-ups


Hi,

On 04/01/2013 06:50 PM, Jason Merrill wrote:
On 04/01/2013 12:41 PM, Paolo Carlini wrote:
+#define DECL_FUNCTION_TEMPLATE_P(NODE)                          \
+  (TREE_CODE (NODE) == TEMPLATE_DECL \
+   && DECL_TEMPLATE_RESULT (NODE) != NULL_TREE            \
Do we need the NULL_TREE check? That is, do we still build a template with no result?
Honestly, I don't know, I followed DECL_TYPE_TEMPLATE_P, I can see what happens if I remove it...

PS: In my opinion we should also rename DECL_FUNCTION_MEMBER_P to DECL_MEMBER_FUNCTION_P. Objections?

The current name makes it clearer (to me, anyway) that the macro assumes that we already know we're looking at a FUNCTION_DECL.
Ok, the subtlety wasn't clean to me looking at the other predicates and the comment. Let's leave it alone for now.

Paolo.


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