Commit 44696e78 authored by mmitchel's avatar mmitchel
Browse files

* pt.c (push_template_decl_real): Use template declaration from

	class type if it exists.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@28978 138bc75d-0d04-0410-961f-82ee72b054a4
parent a542c230
1999-08-29 Alex Samuel <samuel@codesourcery.com>
* pt.c (push_template_decl_real): Use template declaration from
class type if it exists.
1999-08-29 Mark Mitchell <mark@codesourcery.com>
 
* cp-tree.h (TYPE_NEEDS_CONSTRUCTING): Remove #if 0'd definition.
......
......@@ -2461,6 +2461,22 @@ push_template_decl_real (decl, is_friend)
&& DECL_TEMPLATE_INFO (decl)
&& DECL_TI_TEMPLATE (decl))
tmpl = DECL_TI_TEMPLATE (decl);
/* If DECL is a TYPE_DECL for a class-template, then there won't
be DECL_LANG_SPECIFIC. The information equivalent to
DECL_TEMPLATE_INFO is found in TYPE_TEMPLATE_INFO instead. */
else if (DECL_IMPLICIT_TYPEDEF_P (decl)
&& TYPE_TEMPLATE_INFO (TREE_TYPE (decl))
&& TYPE_TI_TEMPLATE (TREE_TYPE (decl)))
{
/* Since a template declaration already existed for this
class-type, we must be redeclaring it here. Make sure
that the redeclaration is legal. */
redeclare_class_template (TREE_TYPE (decl),
current_template_parms);
/* We don't need to create a new TEMPLATE_DECL; just use the
one we already had. */
tmpl = TYPE_TI_TEMPLATE (TREE_TYPE (decl));
}
else
{
tmpl = build_template_decl (decl, current_template_parms);
......
// Build don't link:
// Origin: Alex Samuel <samuel@codesourcery.com>
namespace Outer
{
template <class T> class Inner;
}
template <class T>
class Outer::Inner
{
public:
Inner ();
};
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