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] [PR17447] Check incomplete types of parameters intemplates


Giovanni Bajo wrote:

Gabriel Dos Reis wrote:



I thought the common practice had been to avoid uses_template_parms,
in preference of dependent_xxx_p.



AFAICT, not after Mark rewrote it before 3.4 to avoid using walk_tree and
allocating a hash table (that is, painfully slow). dependent_type_p won't work
here as-is, I would have to put ++processing_template_decl before
and --processing_template_decl after its use, which is exactly what
uses_template_parms does.



It could be argued that dependent_type_p should work also outside templates,
and then fix all its uses. I would support that, but it's a cleanup for 4.1 at
this point, and surely this patch can live with uses_template_parms at the
moment.



The fact that dependent_type_p does not check with processing_template_parms is zero is an important optimization., so I would not like this change.

I think that probably processing_template_decl should be getting set earlier. Normally, it is set right after "template <...>" -- but for "preparsed" functions something is not setting this, I take it. What does the call stack look like when we are getting here with a template function, but with processing_template_decl not set?

Thanks,

--
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com


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