From 52710d27d17c1aad66c5acfc6bae9ced736c0cad Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 1 Apr 2014 17:25:42 -0400 Subject: [PATCH] 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 --- gcc/cp/ChangeLog | 3 +++ gcc/cp/pt.c | 8 +++++--- gcc/testsuite/g++.dg/cpp0x/pr31439.C | 2 +- gcc/testsuite/g++.dg/cpp0x/vt-33964.C | 2 +- gcc/testsuite/g++.dg/template/crash97.C | 2 +- gcc/testsuite/g++.dg/template/crash98.C | 2 +- gcc/testsuite/g++.dg/template/partial5.C | 4 ++-- 7 files changed, 14 insertions(+), 9 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 764400c78554..6c9a31de93e3 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2014-04-01 Jason Merrill + * 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. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 9de00d556e20..7f4ef8b3519b 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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) diff --git a/gcc/testsuite/g++.dg/cpp0x/pr31439.C b/gcc/testsuite/g++.dg/cpp0x/pr31439.C index f75373555ce4..df50e41cdb54 100644 --- a/gcc/testsuite/g++.dg/cpp0x/pr31439.C +++ b/gcc/testsuite/g++.dg/cpp0x/pr31439.C @@ -1,7 +1,7 @@ // { dg-do compile { target c++11 } } template struct A; -template struct A<> {}; // { dg-error "not used in partial specialization|anonymous|declaration" } +template struct A<> {}; // { dg-error "not deducible|anonymous|declaration" } template struct A : A {}; // { dg-error "incomplete type" } diff --git a/gcc/testsuite/g++.dg/cpp0x/vt-33964.C b/gcc/testsuite/g++.dg/cpp0x/vt-33964.C index 9e40737d5f0b..8cbc0d6478d6 100644 --- a/gcc/testsuite/g++.dg/cpp0x/vt-33964.C +++ b/gcc/testsuite/g++.dg/cpp0x/vt-33964.C @@ -6,7 +6,7 @@ struct foo }; template -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; }; diff --git a/gcc/testsuite/g++.dg/template/crash97.C b/gcc/testsuite/g++.dg/template/crash97.C index 3d177f4e5341..7d2161f54f3e 100644 --- a/gcc/testsuite/g++.dg/template/crash97.C +++ b/gcc/testsuite/g++.dg/template/crash97.C @@ -2,7 +2,7 @@ template struct A {}; -template struct A // { dg-error "not used|template\\-parameter" } +template struct A // { dg-error "not deducible|template\\-parameter" } { template void foo(); }; diff --git a/gcc/testsuite/g++.dg/template/crash98.C b/gcc/testsuite/g++.dg/template/crash98.C index a79ab02f695f..9d7d2ece1458 100644 --- a/gcc/testsuite/g++.dg/template/crash98.C +++ b/gcc/testsuite/g++.dg/template/crash98.C @@ -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 (); diff --git a/gcc/testsuite/g++.dg/template/partial5.C b/gcc/testsuite/g++.dg/template/partial5.C index aa32e3b8a419..979e4c62bf6b 100644 --- a/gcc/testsuite/g++.dg/template/partial5.C +++ b/gcc/testsuite/g++.dg/template/partial5.C @@ -4,7 +4,7 @@ template struct X { }; template -struct X { }; // { dg-error "not used|T" } +struct X { }; // { dg-error "not deducible|T" } template struct X {}; // okay @@ -14,7 +14,7 @@ template struct Y { }; template -struct Y { }; // { dg-error "not used|U" } +struct Y { }; // { dg-error "not deducible|U" } template -- 2.47.2