diff options
author | Mark Mitchell <mmitchell@usa.net> | 1998-03-19 09:08:53 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1998-03-19 09:08:53 +0000 |
commit | 366c0f1ec0f31bc82af70722dc1f28b14808546b (patch) | |
tree | ffc93dae6ddd17c3341d21ad9fe0957ee33a2952 /gcc | |
parent | ecb0676809f5683739bc2316cf350fde0e034a94 (diff) | |
download | gcc-366c0f1ec0f31bc82af70722dc1f28b14808546b.zip gcc-366c0f1ec0f31bc82af70722dc1f28b14808546b.tar.gz gcc-366c0f1ec0f31bc82af70722dc1f28b14808546b.tar.bz2 |
pt.c (check_explicit_specialization): When reverting a static member function...
* pt.c (check_explicit_specialization): When reverting a static
member function, also remove the `this' parameter from
last_function_parms.
From-SVN: r18704
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/pt.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/static1.C | 21 |
3 files changed, 31 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 45e0de0..2fe1fa9 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +Wed Mar 19 09:08:12 1998 Mark Mitchell <mmitchell@usa.net> + + * pt.c (check_explicit_specialization): When reverting a static + member function, also remove the `this' parameter from + last_function_parms. + Thu Mar 19 02:27:48 1998 Jason Merrill <jason@yorick.cygnus.com> * pt.c (tsubst_copy, CONST_DECL): Don't bother tsubsting diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 7609ee5..1bd8dbb 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -975,7 +975,10 @@ check_explicit_specialization (declarator, decl, template_count, flags) } else if (DECL_STATIC_FUNCTION_P (tmpl) && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)) - revert_static_member_fn (&decl, 0, 0); + { + revert_static_member_fn (&decl, 0, 0); + last_function_parms = TREE_CHAIN (last_function_parms); + } /* Mangle the function name appropriately. Note that we do not mangle specializations of non-template member diff --git a/gcc/testsuite/g++.old-deja/g++.pt/static1.C b/gcc/testsuite/g++.old-deja/g++.pt/static1.C new file mode 100644 index 0000000..67e2363 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/static1.C @@ -0,0 +1,21 @@ +extern "C" void abort(); + +template <class T> +class A +{ + public: + static int foo(int); +}; + +template <> +int A<int>::foo(int i) +{ + return i; +} + + +int main() +{ + if (A<int>::foo(22) != 22) + abort(); +} |