mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-07 14:57:21 +08:00
decl.c (grokdeclarator): Update the name of the TEMPLATE_DECL...
* decl.c (grokdeclarator): Update the name of the TEMPLATE_DECL, as well as the TYPE_DECL, when a typedef name is assigned to a previously anonymous type. From-SVN: r24218
This commit is contained in:
parent
a0078b3709
commit
33964bf4af
@ -1,3 +1,9 @@
|
||||
1998-12-09 Mark Mitchell <mark@markmitchell.com>
|
||||
|
||||
* decl.c (grokdeclarator): Update the name of the TEMPLATE_DECL, as
|
||||
well as the TYPE_DECL, when a typedef name is assigned to a
|
||||
previously anonymous type.
|
||||
|
||||
1998-12-08 Andrew MacLeod <amacleod@cygnus.com>
|
||||
|
||||
* cp/except.c (call_eh_info): use __start_cp_handler instead of
|
||||
|
@ -10378,6 +10378,13 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
|
||||
if (TYPE_LANG_SPECIFIC (type))
|
||||
TYPE_WAS_ANONYMOUS (type) = 1;
|
||||
|
||||
/* If this is a typedef within a template class, the nested
|
||||
type is a (non-primary) template. The name for the
|
||||
template needs updating as well. */
|
||||
if (TYPE_LANG_SPECIFIC (type) && CLASSTYPE_TEMPLATE_INFO (type))
|
||||
DECL_NAME (CLASSTYPE_TI_TEMPLATE (type))
|
||||
= TYPE_IDENTIFIER (type);
|
||||
|
||||
/* XXX Temporarily set the scope.
|
||||
When returning, start_decl expects it as NULL_TREE,
|
||||
and will then then set it using pushdecl. */
|
||||
|
24
gcc/testsuite/g++.old-deja/g++.pt/derived1.C
Normal file
24
gcc/testsuite/g++.old-deja/g++.pt/derived1.C
Normal file
@ -0,0 +1,24 @@
|
||||
// Build don't link:
|
||||
|
||||
class A
|
||||
{
|
||||
public:
|
||||
typedef int Info;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class B : public A
|
||||
{
|
||||
public:
|
||||
typedef struct{
|
||||
int a;
|
||||
int b;
|
||||
} Info;
|
||||
};
|
||||
|
||||
void f()
|
||||
{
|
||||
B<A>::Info ie;
|
||||
ie.a=1;
|
||||
ie.b=2;
|
||||
}
|
Loading…
Reference in New Issue
Block a user