Commit d03d18e8 by Kriang Lerdsuwanakij Committed by Kriang Lerdsuwanakij

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
parent ba59df78
2002-07-17 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
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 <lerdsuwa@users.sourceforge.net>
PR c++/4802, c++/5387
* decl.c (make_typename_type): Use enforce_access.
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment