public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [C++ PATCH] Fix handling of canonical types for nested BOUND_TEMPLATE_TEMPLATE_PARMS
@ 2007-01-04 15:28 Doug Gregor
  2007-01-05  3:38 ` Mark Mitchell
  0 siblings, 1 reply; 2+ messages in thread
From: Doug Gregor @ 2007-01-04 15:28 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: Jan Hubicka, Mark Mitchell, GCC Patches

[C++ patch below]

On 1/4/07, Andrew Pinski <pinskia@physics.uc.edu> wrote:
> > > That indicates a bug in the handling of canonical types. If you had
> > > compiled with --disable-checking, it would probably ICE or fail to
> > > compile tramp3d.
> >
> > Actually I would expect more ICEs with --enable-checking than wihtout.
>
> In fact this really should have been an ICE instead of an warning.
> Even if I add -w, I still get part of the warning out which is annoying.

We could just make it an ICE, rather than a warning, to increase the
urgency of errors in the canonical types patch... I'll submit that
separately in a few days. I'd like to see if there are any more
reports from the warning before we up the ante.

> Here is a reduced testcase for the problem:
> template<class Mesh> class Field { };
> template <int Dim>
> struct CentX
> {
>    template <template <int> class Mesh >
>    void df(Field<Mesh<Dim> > );
> };
> CentX<3> a1;
>
>
> I thought everyone would love this testcase which is why I am adding it
> here.

Wonderful, thank you. Turns out that it was a trivial fix in the
handling of member templates.

Patch and ChangeLog follow.

Tested i686-pc-linux-gnu; no regressions.

  Cheers,
  Doug

Index: pt.c
===================================================================
--- pt.c        (revision 120438)
+++ pt.c        (working copy)
@@ -7530,6 +7530,8 @@ tsubst (tree t, tree args, tsubst_flags_
                     require structural equality checking to compare
                     TEMPLATE_TEMPLATE_PARMs. */
                  SET_TYPE_STRUCTURAL_EQUALITY (r);
+               else if (TYPE_STRUCTURAL_EQUALITY_P (t))
+                 SET_TYPE_STRUCTURAL_EQUALITY (r);
                else
                  TYPE_CANONICAL (r) = canonical_type_parameter (r);

2007-01-04  Douglas Gregor  <doug.gregor@gmail.com>

	* pt.c (tsubst): Propagate the need for structural equality checks
	when reducing the level of template parameters.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [C++ PATCH] Fix handling of canonical types for nested BOUND_TEMPLATE_TEMPLATE_PARMS
  2007-01-04 15:28 [C++ PATCH] Fix handling of canonical types for nested BOUND_TEMPLATE_TEMPLATE_PARMS Doug Gregor
@ 2007-01-05  3:38 ` Mark Mitchell
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Mitchell @ 2007-01-05  3:38 UTC (permalink / raw)
  To: Doug Gregor; +Cc: Andrew Pinski, Jan Hubicka, GCC Patches

Doug Gregor wrote:

> Index: pt.c
> ===================================================================
> --- pt.c        (revision 120438)
> +++ pt.c        (working copy)
> @@ -7530,6 +7530,8 @@ tsubst (tree t, tree args, tsubst_flags_
>                     require structural equality checking to compare
>                     TEMPLATE_TEMPLATE_PARMs. */
>                  SET_TYPE_STRUCTURAL_EQUALITY (r);
> +               else if (TYPE_STRUCTURAL_EQUALITY_P (t))
> +                 SET_TYPE_STRUCTURAL_EQUALITY (r);
>                else
>                  TYPE_CANONICAL (r) = canonical_type_parameter (r);
> 
> 2007-01-04  Douglas Gregor  <doug.gregor@gmail.com>
> 
>     * pt.c (tsubst): Propagate the need for structural equality checks
>     when reducing the level of template parameters.

OK, thanks.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-01-05  3:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-04 15:28 [C++ PATCH] Fix handling of canonical types for nested BOUND_TEMPLATE_TEMPLATE_PARMS Doug Gregor
2007-01-05  3:38 ` Mark Mitchell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).