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
This commit is contained in:
parent
093e61a6d1
commit
d12a72831c
4 changed files with 32 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
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);
|
||||
}
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
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.
|
||||
|
|
20
gcc/testsuite/g++.dg/template/ttp5.C
Normal file
20
gcc/testsuite/g++.dg/template/ttp5.C
Normal file
|
@ -0,0 +1,20 @@
|
|||
// { 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" }
|
||||
};
|
Loading…
Add table
Reference in a new issue