Commit f31d0b12 by Jason Merrill Committed by Jason Merrill

pt.c (determine_specialization): Print candidates after 'no match' error.

	* pt.c (determine_specialization): Print candidates after 'no
	match' error.

From-SVN: r226653
parent a2b4cfaa
2015-08-05 Jason Merrill <jason@redhat.com> 2015-08-05 Jason Merrill <jason@redhat.com>
* pt.c (determine_specialization): Print candidates after 'no
match' error.
* decl.c (cp_finish_decl): Tidy. * decl.c (cp_finish_decl): Tidy.
* typeck.c (finish_class_member_access_expr): Use * typeck.c (finish_class_member_access_expr): Use
type_dependent_expression_p. type_dependent_expression_p.
......
...@@ -1952,6 +1952,8 @@ determine_specialization (tree template_id, ...@@ -1952,6 +1952,8 @@ determine_specialization (tree template_id,
b = b->level_chain) b = b->level_chain)
++header_count; ++header_count;
tree orig_fns = fns;
if (variable_template_p (fns)) if (variable_template_p (fns))
{ {
tree parms = INNERMOST_TEMPLATE_PARMS (DECL_TEMPLATE_PARMS (fns)); tree parms = INNERMOST_TEMPLATE_PARMS (DECL_TEMPLATE_PARMS (fns));
...@@ -2168,6 +2170,8 @@ determine_specialization (tree template_id, ...@@ -2168,6 +2170,8 @@ determine_specialization (tree template_id,
inform (input_location, "saw %d %<template<>%>, need %d for " inform (input_location, "saw %d %<template<>%>, need %d for "
"specializing a member function template", "specializing a member function template",
header_count, template_count + 1); header_count, template_count + 1);
else
print_candidates (orig_fns);
return error_mark_node; return error_mark_node;
} }
else if ((templates && TREE_CHAIN (templates)) else if ((templates && TREE_CHAIN (templates))
......
template <class T> void f(T); // { dg-message "void f" }
template <> int f(int); // { dg-error "does not match" }
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