From: Jason Merrill Date: Thu, 6 Aug 2015 01:33:32 +0000 (-0400) Subject: pt.c (determine_specialization): Print candidates after 'no match' error. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f31d0b122fcfbd94a6b94a03d706e98e53a0798b;p=gcc.git pt.c (determine_specialization): Print candidates after 'no match' error. * pt.c (determine_specialization): Print candidates after 'no match' error. From-SVN: r226653 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 502dc204302..986b942f400 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2015-08-05 Jason Merrill + * pt.c (determine_specialization): Print candidates after 'no + match' error. + * decl.c (cp_finish_decl): Tidy. * typeck.c (finish_class_member_access_expr): Use type_dependent_expression_p. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 5f28f1b5637..08fb2ffb431 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -1952,6 +1952,8 @@ determine_specialization (tree template_id, b = b->level_chain) ++header_count; + tree orig_fns = fns; + if (variable_template_p (fns)) { tree parms = INNERMOST_TEMPLATE_PARMS (DECL_TEMPLATE_PARMS (fns)); @@ -2168,6 +2170,8 @@ determine_specialization (tree template_id, inform (input_location, "saw %d %%>, need %d for " "specializing a member function template", header_count, template_count + 1); + else + print_candidates (orig_fns); return error_mark_node; } else if ((templates && TREE_CHAIN (templates)) diff --git a/gcc/testsuite/g++.dg/template/spec39.C b/gcc/testsuite/g++.dg/template/spec39.C new file mode 100644 index 00000000000..9e4f8beadb4 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/spec39.C @@ -0,0 +1,3 @@ +template void f(T); // { dg-message "void f" } +template <> int f(int); // { dg-error "does not match" } +