Commit 52710d27 by Jason Merrill Committed by Jason Merrill

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
parent cd8a9d6d
2014-04-01 Jason Merrill <jason@redhat.com> 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 PR c++/60374
* pt.c (coerce_template_parms): Check that the pack expansion * pt.c (coerce_template_parms): Check that the pack expansion
pattern works with the first matching parameter. pattern works with the first matching parameter.
......
...@@ -4139,15 +4139,17 @@ process_partial_specialization (tree decl) ...@@ -4139,15 +4139,17 @@ process_partial_specialization (tree decl)
for (i = 0; i < ntparms; ++i) for (i = 0; i < ntparms; ++i)
if (tpd.parms[i] == 0) 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. */ specialization. */
if (!did_error_intro) if (!did_error_intro)
{ {
error ("template parameters not used in partial specialization:"); error ("template parameters not deducible in "
"partial specialization:");
did_error_intro = true; 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) if (did_error_intro)
......
// { dg-do compile { target c++11 } } // { dg-do compile { target c++11 } }
template<typename...> struct A; 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" } template<typename T, typename... U> struct A<T, U...> : A<U...> {}; // { dg-error "incomplete type" }
......
...@@ -6,7 +6,7 @@ struct foo ...@@ -6,7 +6,7 @@ struct foo
}; };
template<typename ... Args> 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; static bool const value = false;
}; };
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
template<typename> struct A {}; 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(); template<int> void foo();
}; };
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
template < typename > struct A; 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 i;
int f (); int f ();
......
...@@ -4,7 +4,7 @@ template<typename T> ...@@ -4,7 +4,7 @@ template<typename T>
struct X { }; struct X { };
template<typename T> 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> template<int N>
struct X<int[N]> {}; // okay struct X<int[N]> {}; // okay
...@@ -14,7 +14,7 @@ template<typename T, typename T::foo V> ...@@ -14,7 +14,7 @@ template<typename T, typename T::foo V>
struct Y { }; struct Y { };
template<typename T, typename U, U v> 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> template<typename T, T V>
......
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