pt.c (process_partial_specialization): Say "not deducible" rather than "not used".

* pt.c (process_partial_specialization): Say "not deducible"
	rather than "not used".  Use inform.

From-SVN: r209000
This commit is contained in:
Jason Merrill 2014-04-01 17:25:42 -04:00 committed by Jason Merrill
parent cd8a9d6d1c
commit 52710d27d1
7 changed files with 14 additions and 9 deletions

View File

@ -1,5 +1,8 @@
2014-04-01 Jason Merrill <jason@redhat.com>
* pt.c (process_partial_specialization): Say "not deducible"
rather than "not used". Use inform.
PR c++/60374
* pt.c (coerce_template_parms): Check that the pack expansion
pattern works with the first matching parameter.

View File

@ -4139,15 +4139,17 @@ process_partial_specialization (tree decl)
for (i = 0; i < ntparms; ++i)
if (tpd.parms[i] == 0)
{
/* One of the template parms was not used in the
/* One of the template parms was not used in a deduced context in the
specialization. */
if (!did_error_intro)
{
error ("template parameters not used in partial specialization:");
error ("template parameters not deducible in "
"partial specialization:");
did_error_intro = true;
}
error (" %qD", TREE_VALUE (TREE_VEC_ELT (inner_parms, i)));
inform (input_location, " %qD",
TREE_VALUE (TREE_VEC_ELT (inner_parms, i)));
}
if (did_error_intro)

View File

@ -1,7 +1,7 @@
// { dg-do compile { target c++11 } }
template<typename...> struct A;
template<char> struct A<> {}; // { dg-error "not used in partial specialization|anonymous|declaration" }
template<char> struct A<> {}; // { dg-error "not deducible|anonymous|declaration" }
template<typename T, typename... U> struct A<T, U...> : A<U...> {}; // { dg-error "incomplete type" }

View File

@ -6,7 +6,7 @@ struct foo
};
template<typename ... Args>
struct foo< typename Args::is_applied... > // { dg-error "not used|Args" }
struct foo< typename Args::is_applied... > // { dg-error "not deducible|Args" }
{
static bool const value = false;
};

View File

@ -2,7 +2,7 @@
template<typename> struct A {};
template<typename> struct A<int> // { dg-error "not used|template\\-parameter" }
template<typename> struct A<int> // { dg-error "not deducible|template\\-parameter" }
{
template<int> void foo();
};

View File

@ -2,7 +2,7 @@
template < typename > struct A;
template < typename > struct A < int > // { dg-error "not used|template\\-parameter|declaration" }
template < typename > struct A < int > // { dg-error "not deducible|template\\-parameter|declaration" }
{
int i;
int f ();

View File

@ -4,7 +4,7 @@ template<typename T>
struct X { };
template<typename T>
struct X<typename T::foo> { }; // { dg-error "not used|T" }
struct X<typename T::foo> { }; // { dg-error "not deducible|T" }
template<int N>
struct X<int[N]> {}; // okay
@ -14,7 +14,7 @@ template<typename T, typename T::foo V>
struct Y { };
template<typename T, typename U, U v>
struct Y<T, v> { }; // { dg-error "not used|U" }
struct Y<T, v> { }; // { dg-error "not deducible|U" }
template<typename T, T V>