This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] PR c++/26693
- From: Jason Merrill <jason at redhat dot com>
- To: Dodji Seketeli <dodji at redhat dot com>
- Cc: Manuel LÃpez-IbÃÃez <lopezibanez at gmail dot com>, Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 12 Nov 2008 16:45:45 -0500
- Subject: Re: [PATCH] PR c++/26693
- References: <4908DEAF.email@example.com> <firstname.lastname@example.org> <4909C2F6.email@example.com> <490F4917.firstname.lastname@example.org> <491AE5DE.email@example.com>
Dodji Seketeli wrote:
2/ When tsubst() encounters a typedef variant type, it tries to "reuse"
its specialization, instead of tsubst-ing its main variant type. This
works great. But when the main variant type is a TYPENAME_TYPE, I think
we need to make sure the main variant type can be properly tsubst-ed
before attempting to reuse the specialization of the typedef variant
This sounds wrong to me: if tsubsting the TYPENAME_TYPE was going to be
a problem, we ought to get that error when we instantiate the class of
which the typedef is a member.
+ if (DECL_IS_BUILTIN (x)
+ || (TREE_TYPE (x) != error_mark_node
+ && TYPE_NAME (type) != x
+ /* We don't want to copy the type when all we're
+ doing is making a TYPE_DECL for the purposes of
+ inlining. */
+ && (!TYPE_NAME (type)
+ || TYPE_NAME (type) != DECL_ABSTRACT_ORIGIN (x))))
+ clone_underlying_type (x);
This is wrong: if DECL_IS_BUILTIN (x) we don't want to create a typedef
variant, we just want to set TYPE_NAME (type) to x.