PR c++/23293
* pt.c (convert_template_argument): Use canonical type variants in
template specializations.
PR c++/23293
* g++.dg/template/error19.C: New test.
From-SVN: r105561
+2005-10-18 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/23293
+ * pt.c (convert_template_argument): Use canonical type variants in
+ template specializations.
+
2005-10-18 Nathan Sidwell <nathan@codesourcery.com>
PR c++/21383
}
else
val = arg;
+ /* We only form one instance of each template specialization.
+ Therefore, if we use a non-canonical variant (i.e., a
+ typedef), any future messages referring to the type will use
+ the typedef, which is confusing if those future uses do not
+ themselves also use the typedef. */
+ if (TYPE_P (val))
+ val = canonical_type_variant (val);
}
else
{
+2005-10-18 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/23293
+ * g++.dg/template/error19.C: New test.
+
2005-10-18 Nathan Sidwell <nathan@codesourcery.com>
PR c++/21383
--- /dev/null
+// PR c++/23293
+
+template < typename > struct P;
+struct S;
+
+void *unrelated_function()
+{
+ typedef S K;
+ P < K > * p;
+ return p;
+}
+
+template < typename U >
+void generate_warning()
+{
+ U::x(); // { dg-error "P<S>" }
+}
+
+int main()
+{
+ generate_warning< P < S > >();
+}