+2010-04-20 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/43800
+ PR c++/43704
+ * typeck.c (incompatible_dependent_types_p): If one of the
+ compared types if not a typedef then honour their main variant
+ equivalence.
+
2010-04-20 Jakub Jelinek <jakub@redhat.com>
* cp-tree.h (TYPE_REF_IS_RVALUE): Remove.
incompatible_dependent_types_p (tree t1, tree t2)
{
tree tparms1 = NULL_TREE, tparms2 = NULL_TREE;
+ bool t1_typedef_variant_p, t2_typedef_variant_p;
if (!uses_template_parms (t1) || !uses_template_parms (t2))
return false;
return true;
}
+ t1_typedef_variant_p = typedef_variant_p (t1);
+ t2_typedef_variant_p = typedef_variant_p (t2);
+
/* Either T1 or T2 must be a typedef. */
- if (!typedef_variant_p (t1) && !typedef_variant_p (t2))
+ if (!t1_typedef_variant_p && !t2_typedef_variant_p)
return false;
+ if (!t1_typedef_variant_p || !t2_typedef_variant_p)
+ /* Either T1 or T2 is not a typedef so we cannot compare the
+ the template parms of the typedefs of T1 and T2.
+ At this point, if the main variant type of T1 and T2 are equal
+ it means the two types can't be incompatible, from the perspective
+ of this function. */
+ if (TYPE_MAIN_VARIANT (t1) == TYPE_MAIN_VARIANT (t2))
+ return false;
+
/* So if we reach this point, it means either T1 or T2 is a typedef variant.
Let's compare their template parameters. */
+2010-04-20 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/43800
+ PR c++/43704
+ * g++.dg/template/typedef32.C: Adjust.
+ * g++.dg/template/typedef33.C: New test.
+
2010-04-20 Paul Thomas <pault@gcc.gnu.org>
PR fortran/43227