commit a54cb70add522cfa4c10cc1efc39108db7a7d60f
Author: Jason Merrill <jason@redhat.com>
Date: Wed Aug 5 17:03:08 2015 -0400
* pt.c (determine_specialization): Print candidates after 'no
match' error.
@@ -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 %<template<>%>, 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))
new file mode 100644
@@ -0,0 +1,3 @@
+template <class T> void f(T); // { dg-message "void f" }
+template <> int f(int); // { dg-error "does not match" }
+