Commit 54062fc0 by Paolo Carlini Committed by Paolo Carlini

re PR c++/35282 (Template specialization rejected)

/testsuite
2008-02-22  Paolo Carlini  <pcarlini@suse.de>

	PR c++/35282
	* g++.dg/template/nontype17.C: Add.

/cp
2008-02-22  Paolo Carlini  <pcarlini@suse.de>

	PR c++/35282
	Revert:
	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-22  Paolo Carlini  <pcarlini@suse.de>

	PR c++/35282
	Revert:
	2008-02-14  Paolo Carlini  <pcarlini@suse.de>

        PR c++/28743
	* g++.dg/template/nontype17.C: New.
        * g++.dg/template/nontype16.C: Add error.

From-SVN: r132543
parent 4af63337
2008-02-22 Paolo Carlini <pcarlini@suse.de>
PR c++/35282
Revert:
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-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
PR c/19999
......
......@@ -1563,9 +1563,12 @@ determine_specialization (tree template_id,
no partial specializations of functions. Therefore, if
the type of DECL does not match FN, there is no
match. */
if (tsk == tsk_template
&& !compparms (fn_arg_types, decl_arg_types))
continue;
if (tsk == tsk_template)
{
if (compparms (fn_arg_types, decl_arg_types))
candidates = tree_cons (NULL_TREE, fn, candidates);
continue;
}
/* See whether this function might be a specialization of this
template. */
......
2008-02-22 Paolo Carlini <pcarlini@suse.de>
PR c++/35282
* g++.dg/template/nontype17.C: Add.
2008-02-22 Paolo Carlini <pcarlini@suse.de>
PR c++/35282
Revert:
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-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
PR c/19999
......@@ -5,5 +5,5 @@ template<int> struct A
template<typename> void foo();
};
template<> template<struct T> void A<0>::foo() {} // { dg-error "not a valid type|match" }
template<> template<struct T> void A<0>::foo() {} // { dg-error "not a valid type" }
// PR c++/28743
// PR c++/35282
template<int> struct A
{
template<typename> void foo();
template<int> void foo();
};
template<int> template<typename> void A<0>::foo() {} // { dg-error "match" }
template<> template<int> void A<0>::foo() {}
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