From: Mark Mitchell Date: Thu, 19 Mar 1998 09:08:53 +0000 (+0000) Subject: pt.c (check_explicit_specialization): When reverting a static member function... X-Git-Tag: prereleases/egcs-1.1-prerelease~2035 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=366c0f1ec0f31bc82af70722dc1f28b14808546b;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 45e0de07a094..2fe1fa932b0e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +Wed Mar 19 09:08:12 1998 Mark Mitchell + + * 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 * pt.c (tsubst_copy, CONST_DECL): Don't bother tsubsting diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 7609ee51c55b..1bd8dbb904fd 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 000000000000..67e236316004 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/static1.C @@ -0,0 +1,21 @@ +extern "C" void abort(); + +template +class A +{ + public: + static int foo(int); +}; + +template <> +int A::foo(int i) +{ + return i; +} + + +int main() +{ + if (A::foo(22) != 22) + abort(); +}