+2004-03-09 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ PR c++/14409
+ * pt.c (determine_specialization): For member templates, match also
+ constness.
+
2004-03-05 Gabriel Dos Reis <gdr@integrable-solutions.net>
Backport:
if (TREE_CODE (fn) == TEMPLATE_DECL)
{
tree decl_arg_types;
+ tree fn_arg_types;
/* DECL might be a specialization of FN. */
The specialization f<int> is invalid but is not caught
by get_bindings below. */
- if (list_length (TYPE_ARG_TYPES (TREE_TYPE (fn)))
- != list_length (decl_arg_types))
+ fn_arg_types = TYPE_ARG_TYPES (TREE_TYPE (fn));
+ if (list_length (fn_arg_types) != list_length (decl_arg_types))
+ continue;
+
+ /* For a non-static member function, we need to make sure that
+ the const qualification is the same. This can be done by
+ checking the 'this' in the argument list. */
+ if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)
+ && !same_type_p (TREE_VALUE (fn_arg_types),
+ TREE_VALUE (decl_arg_types)))
continue;
/* See whether this function might be a specialization of this
+2004-03-09 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ PR c++/14409
+ * g++.dg/template/spec12.C: New test.
+
2004-03-06 Ulrich Weigand <uweigand@de.ibm.com>
* gcc.dg/20040306-1.c: New test.