re PR c++/10845 (template member function (getting a nested template as parameter) cannot be called anymore if another unrelated template member function is defined.)

PR c++/10845
	* pt.c (try_class_unification): Correct handling of member class
	templates.

	* semantics.c (genrtl_finish_function): Adjust
	expand_function_end call.

From-SVN: r68269
This commit is contained in:
Mark Mitchell 2003-06-20 15:44:25 +00:00 committed by Mark Mitchell
parent f5a6463ed6
commit 68361a0396
4 changed files with 32 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2003-06-20 Mark Mitchell <mark@codesourcery.com>
PR c++/10845
* pt.c (try_class_unification): Correct handling of member class
templates.
2003-06-20 Nathan Sidwell <nathan@codesourcery.com>
* semantics.c (genrtl_finish_function): Adjust

View File

@ -9078,7 +9078,8 @@ try_class_unification (tree tparms, tree targs, tree parm, tree arg)
tree copy_of_targs;
if (!CLASSTYPE_TEMPLATE_INFO (arg)
|| CLASSTYPE_TI_TEMPLATE (arg) != CLASSTYPE_TI_TEMPLATE (parm))
|| (most_general_template (CLASSTYPE_TI_TEMPLATE (arg))
!= most_general_template (CLASSTYPE_TI_TEMPLATE (parm))))
return NULL_TREE;
/* We need to make a new template argument vector for the call to

View File

@ -1,3 +1,8 @@
2003-06-20 Mark Mitchell <mark@codesourcery.com>
PR c++/10845
* g++.dg/template/member3.C: New test.
2003-06-19 Mark Mitchell <mark@codesourcery.com>
PR c++/10939

View File

@ -0,0 +1,19 @@
template<typename T>
struct A {
template<typename L> struct SubA { };
template<typename T1,typename L> void f(T1 & t1, SubA<L> & t2) { }
template<typename U> void g(SubA<U> & suba) { }
template<typename U> void h(SubA<U> & suba) { }
};
int main(void) {
int i;
A<int> a;
A<int>::SubA<int> suba;
a.f(i,suba);
a.g(suba);
a.h(suba);
}