[RFA] PR c++/39637

Dodji Seketeli dodji@redhat.com
Mon Apr 6 17:42:00 GMT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mark Mitchell a écrit :

> 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.

OK.

> 
> 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.

The assert aborts during instantiation of the template function f, triggered by
the call to instantiate_pending_templates. We then go through instantiate_decl
and down to subst_enum. We end up substituting the SIZEOF_EXPR that carries the
bogus 'Type' parameter pack, in tsubst_copy_and_build. It's the call to
cxx_sizeof_or_alignof_type, from tsubst_copy_and_build (in the SIZEOF_EXPR case)
that fails. Actually the code looks correct there, because the OP1 parameter
shouldn't be dependent anymore, at that point. So I am not sure where the
processing_template_decl should be set if it should be at all.

Jason was proposing that I rather detect earlier (maybe during the parsing) that
the template parameter pack is being used outside of a pack expansion context.
I'll look into that then.

Thanks.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Remi - http://enigmail.mozdev.org

iEYEARECAAYFAknaPkcACgkQPejI7lrem2F/zgCdFgPLd9PA7/3B8RTPIl+IrIiZ
x90AoJN2ApPuCAQngaWhkeshNXPxgjlg
=MZFs
-----END PGP SIGNATURE-----



More information about the Gcc-patches mailing list