diff options
author | Mark Mitchell <mark@codesourcery.com> | 2001-11-22 00:21:13 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2001-11-22 00:21:13 +0000 |
commit | 12eb9f939a967d5a34c32749705ab5cdfa030742 (patch) | |
tree | 20ebc5c2f5c91c1b998a25e57927cef63691ea1c /gcc | |
parent | 3258e9961c0c10b625cf1bcaf7dec24a5c722f45 (diff) | |
download | gcc-12eb9f939a967d5a34c32749705ab5cdfa030742.zip gcc-12eb9f939a967d5a34c32749705ab5cdfa030742.tar.gz gcc-12eb9f939a967d5a34c32749705ab5cdfa030742.tar.bz2 |
re PR c++/3637 (Internal compiler error in finish_member_declaration)
PR c++/3637
* pt.c (lookup_template_class): Ensure that all specializations
are registered on the list corresponding to the most general
template.
From-SVN: r47252
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/cp/pt.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/memtemp100.C | 40 |
3 files changed, 48 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9d78cbe..9637ab5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,6 +1,12 @@ -2001-11-20 Mark Mitchell <mark@codesourcery.com> +2001-11-21 Mark Mitchell <mark@codesourcery.com> PR c++/3637 + * pt.c (lookup_template_class): Ensure that all specializations + are registered on the list corresponding to the most general + template. + +2001-11-20 Mark Mitchell <mark@codesourcery.com> + * call.c (non_reference): Add documentation. (convert_class_to_reference): Do not strip reference types from conversion operators. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index f1a41f2..f80392a 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -4211,9 +4211,8 @@ lookup_template_class (d1, arglist, in_decl, context, entering_scope, complain) Create the partial instantiation. */ TREE_VEC_LENGTH (arglist)--; - template = tsubst (template, arglist, /*complain=*/0, NULL_TREE); + found = tsubst (template, arglist, /*complain=*/0, NULL_TREE); TREE_VEC_LENGTH (arglist)++; - found = template; } } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp100.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp100.C new file mode 100644 index 0000000..14db8ae --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp100.C @@ -0,0 +1,40 @@ +// Build don't link: +// Origin: philippeb@videotron.ca +// Special g++ Options: + +#include <iostream> + +using namespace std; + +template <class _T> struct traits +{ + typedef long next; +}; + + +template <class _T> +struct c1 +{ + template <class _U> + struct c2 + { + c2() + { + cout << __PRETTY_FUNCTION__ << endl; + } + }; +}; + + +template <class _T> +void foo() +{ + cout << __PRETTY_FUNCTION__ << endl; + c1<typename traits<_T>::next>::c2<void>(); +} + + +int main() +{ + foo<int>(); +} |