2008-02-14 Paolo Carlini <pcarlini@suse.de>
PR c++/28743
* pt.c (determine_specialization): In case of function templates,
when the type of DECL does not match FN there is no match.
/testsuite
2008-02-14 Paolo Carlini <pcarlini@suse.de>
PR c++/28743
* g++.dg/template/nontype17.C: New.
* g++.dg/template/nontype16.C: Add error.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132316
138bc75d-0d04-0410-961f-
82ee72b054a4
+2008-02-14 Paolo Carlini <pcarlini@suse.de>
+
+ PR c++/28743
+ * pt.c (determine_specialization): In case of function templates,
+ when the type of DECL does not match FN there is no match.
+
2008-02-13 Jakub Jelinek <jakub@redhat.com>
Manuel Lopez-Ibanez <manu@gcc.gnu.org>
no partial specializations of functions. Therefore, if
the type of DECL does not match FN, there is no
match. */
- if (tsk == tsk_template)
- {
- if (compparms (fn_arg_types, decl_arg_types))
- candidates = tree_cons (NULL_TREE, fn, candidates);
- continue;
- }
+ if (tsk == tsk_template
+ && !compparms (fn_arg_types, decl_arg_types))
+ continue;
/* See whether this function might be a specialization of this
template. */
+2008-02-14 Paolo Carlini <pcarlini@suse.de>
+
+ PR c++/28743
+ * g++.dg/template/nontype17.C: New.
+ * g++.dg/template/nontype16.C: Add error.
+
2008-02-13 Jakub Jelinek <jakub@redhat.com>
PR c++/35138
template<typename> void foo();
};
-template<> template<struct T> void A<0>::foo() {} // { dg-error "not a valid type" }
+template<> template<struct T> void A<0>::foo() {} // { dg-error "not a valid type|match" }
--- /dev/null
+// PR c++/28743
+
+template<int> struct A
+{
+ template<typename> void foo();
+};
+
+template<int> template<typename> void A<0>::foo() {} // { dg-error "match" }