diff options
author | Mark Mitchell <mark@codesourcery.com> | 2003-06-20 15:44:25 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2003-06-20 15:44:25 +0000 |
commit | 68361a039607fe2fbcd28cb4dae237f13f834f76 (patch) | |
tree | 208e0dedbed5f40e322ebda026ac8fa1ded0ba20 /gcc | |
parent | f5a6463ed684f0d63e6260d8b9705e696845a0aa (diff) | |
download | gcc-68361a039607fe2fbcd28cb4dae237f13f834f76.zip gcc-68361a039607fe2fbcd28cb4dae237f13f834f76.tar.gz gcc-68361a039607fe2fbcd28cb4dae237f13f834f76.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/pt.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/member3.C | 19 |
4 files changed, 32 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f924112..8ed6d9c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 1a43d02..7ce9031 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1e4cafa..ff02c29 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 diff --git a/gcc/testsuite/g++.dg/template/member3.C b/gcc/testsuite/g++.dg/template/member3.C new file mode 100644 index 0000000..4f87e57 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/member3.C @@ -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); +} + |