Commit 685e39c2 by Mark Mitchell Committed by Mark Mitchell

re PR c++/23293 (Misleading names in diagnostics for typedefs in functions)

	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
parent c19aaba5
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
......
......@@ -3930,6 +3930,13 @@ convert_template_argument (tree parm,
}
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
// 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 > >();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment