[RFA] PR c++/39637
Mark Mitchell
mark@codesourcery.com
Mon Apr 6 16:17:00 GMT 2009
Dodji Seketeli wrote:
> In this PR, we crash (on assert) in dependent_type_p(type), called by
> cxx_sizeof_or_alignof_type because the former function expects the
> processing_template_decl flag to be set when TYPE is a TEMPLATE_TYPE_PARM.
>
> Using the more robust function uses_template_params instead of dependent_type_p
> seems to address the issue.
I consider almost all uses of uses_template_params to be a bug. It's an
ill-defined function which involves walking around the tree recursively.
In contrast, dependent_type_p is supposed to implement a well-defined
concept from the standard.
If we're in a context where we might be looking at template parameters,
processing_template_decl should be set. Without more information, it's
hard to figure out where that should have happened.
Thanks,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713
More information about the Gcc-patches
mailing list