This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR c++/50852 - loose template parameter comparison
- From: Jason Merrill <jason at redhat dot com>
- To: Dodji Seketeli <dodji at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 12 Apr 2012 17:08:30 -0400
- Subject: Re: [PATCH] PR c++/50852 - loose template parameter comparison
- References: <m3ehx6saww.fsf@redhat.com>
Sorry for the delay in getting back to you on this; I just keep thinking
there has to be a better way to deal with this issue than this
increasingly complex fixup machinery.
The basic problem we're dealing with is that two typedefs from different
contexts are considered identical for the purpose of template argument
comparison, and we are leaving them in non-type template arguments, so
when we look for a pre-existing specialization one typedef gets replaced
by the other, which breaks.
The fixup stuff is a solution to the problem of typedefs with
incompatible template parameters leading to crashes, but it seems to me
that this is just a symptom of the problem of replacing one typedef with
another, and we should attack that underlying problem instead. That
problem is also visible when the typedefs have different names and an
error message ends up talking about the wrong one.
It seems to me that the way to do this is to strip typedefs from
non-type arguments like strip_typedefs does for types. Did we try this
before?
Ideal would be to treat a specialization using the typedef-using
arguments as a typedef to the specialization using the canonical
arguments, but that could follow on later.
Jason