Commit d12a7283 by Kriang Lerdsuwanakij Committed by Kriang Lerdsuwanakij

re PR c++/8772 (misleading diagnostic for template template parameter)

	PR c++/8772
	* pt.c (convert_template_argument): Correct diagnostic.

	* g++.dg/template/ttp5.C: New test.

From-SVN: r66324
parent 093e61a6
2003-05-01 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/8772
* pt.c (convert_template_argument): Correct diagnostic.
2003-04-30 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/9432, c++/9528
......
......@@ -3579,6 +3579,8 @@ convert_template_argument (parm, arg, args, complain, i, in_decl)
error (" expected a constant of type `%T', got `%T'",
TREE_TYPE (parm),
(is_tmpl_type ? DECL_NAME (arg) : arg));
else if (requires_tmpl_type)
error (" expected a class template, got `%E'", arg);
else
error (" expected a type, got `%E'", arg);
}
......
2003-05-01 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/8772
* g++.dg/template/ttp5.C: New test.
2003-04-30 Mark Mitchell <mark@codesourcery.com>
* lib/g++-dg.exp (g++-dg-test): Add "repo" option.
......
// { dg-do compile }
// Origin: sneechy@hotmail.com
// PR c++/8772: Incorrect diagnostics for template template parameter
// mismatch
template <int> struct A {
template <int> struct B {
enum { v = 1 };
};
};
template <template <int> class F> struct C {
enum { v = F<1>::v || 2 };
};
template <int n> struct D {
enum { v = C<A<n>::B>::v }; // { dg-error "mismatch|class template|not a member" }
};
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