From: Kriang Lerdsuwanakij Date: Wed, 17 Jul 2002 14:07:42 +0000 (+0000) Subject: re PR c++/3797 (gcc 3.0 fails to emit explicit specialization of a template member) X-Git-Tag: releases/gcc-3.3.0~3796 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d03d18e8deab04e1b9c79d84fe91432abdf7ddf3;p=thirdparty%2Fgcc.git re PR c++/3797 (gcc 3.0 fails to emit explicit specialization of a template member) PR c++/3797 * decl.c (duplicate_decls): Don't propagate inlining parameters from olddecl to newdecl when newdecl is a specialization of the instantiation olddecl. From-SVN: r55525 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index bfa365bcba04..6975f32923f5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2002-07-17 Kriang Lerdsuwanakij + + PR c++/3797 + * decl.c (duplicate_decls): Don't propagate inlining parameters from + olddecl to newdecl when newdecl is a specialization of the + instantiation olddecl. + 2002-07-17 Kriang Lerdsuwanakij PR c++/4802, c++/5387 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index c6d77d3321d2..f280384d98f1 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -3366,8 +3366,6 @@ duplicate_decls (newdecl, olddecl) DECL_VIRTUAL_CONTEXT (newdecl) = DECL_VIRTUAL_CONTEXT (olddecl); if (DECL_CONTEXT (olddecl)) DECL_CONTEXT (newdecl) = DECL_CONTEXT (olddecl); - if (DECL_PENDING_INLINE_INFO (newdecl) == 0) - DECL_PENDING_INLINE_INFO (newdecl) = DECL_PENDING_INLINE_INFO (olddecl); DECL_STATIC_CONSTRUCTOR (newdecl) |= DECL_STATIC_CONSTRUCTOR (olddecl); DECL_STATIC_DESTRUCTOR (newdecl) |= DECL_STATIC_DESTRUCTOR (olddecl); DECL_PURE_VIRTUAL_P (newdecl) |= DECL_PURE_VIRTUAL_P (olddecl); @@ -3614,17 +3612,26 @@ duplicate_decls (newdecl, olddecl) olddecl); SET_DECL_TEMPLATE_SPECIALIZATION (olddecl); + + /* [temp.expl.spec/14] We don't inline explicit specialization + just because the primary template says so. */ } - DECL_DECLARED_INLINE_P (newdecl) |= DECL_DECLARED_INLINE_P (olddecl); + else + { + if (DECL_PENDING_INLINE_INFO (newdecl) == 0) + DECL_PENDING_INLINE_INFO (newdecl) = DECL_PENDING_INLINE_INFO (olddecl); - /* If either decl says `inline', this fn is inline, unless its - definition was passed already. */ - if (DECL_INLINE (newdecl) && DECL_INITIAL (olddecl) == NULL_TREE) - DECL_INLINE (olddecl) = 1; - DECL_INLINE (newdecl) = DECL_INLINE (olddecl); + DECL_DECLARED_INLINE_P (newdecl) |= DECL_DECLARED_INLINE_P (olddecl); - DECL_UNINLINABLE (newdecl) = DECL_UNINLINABLE (olddecl) - = (DECL_UNINLINABLE (newdecl) || DECL_UNINLINABLE (olddecl)); + /* If either decl says `inline', this fn is inline, unless + its definition was passed already. */ + if (DECL_INLINE (newdecl) && DECL_INITIAL (olddecl) == NULL_TREE) + DECL_INLINE (olddecl) = 1; + DECL_INLINE (newdecl) = DECL_INLINE (olddecl); + + DECL_UNINLINABLE (newdecl) = DECL_UNINLINABLE (olddecl) + = (DECL_UNINLINABLE (newdecl) || DECL_UNINLINABLE (olddecl)); + } /* Preserve abstractness on cloned [cd]tors. */ DECL_ABSTRACT (newdecl) = DECL_ABSTRACT (olddecl);