decl.c (finish_enum): Handle member enums of classes declared in template functions.
* decl.c (finish_enum): Handle member enums of classes declared in template functions. * decl2.c (grok_x_components): Strip attributres before calling groktypename. From-SVN: r22144
This commit is contained in:
parent
2571e6acfa
commit
9360ac70ad
|
@ -1,3 +1,11 @@
|
|||
1998-08-31 Mark Mitchell <mark@markmitchell.com>
|
||||
|
||||
* decl.c (finish_enum): Handle member enums of classes declared in
|
||||
template functions.
|
||||
|
||||
* decl2.c (grok_x_components): Strip attributres before calling
|
||||
groktypename.
|
||||
|
||||
1998-08-31 Jason Merrill <jason@yorick.cygnus.com>
|
||||
|
||||
* cp-tree.h, decl2.c: Remove support for -fall-virtual,
|
||||
|
|
|
@ -11931,7 +11931,8 @@ finish_enum (enumtype)
|
|||
|
||||
if (processing_template_decl)
|
||||
{
|
||||
if (current_function_decl)
|
||||
tree scope = current_scope ();
|
||||
if (scope && TREE_CODE (scope) == FUNCTION_DECL)
|
||||
{
|
||||
add_tree (build_min (TAG_DEFN, enumtype));
|
||||
resume_temporary_allocation ();
|
||||
|
|
|
@ -853,7 +853,8 @@ grok_x_components (specs, components)
|
|||
|
||||
if (components == NULL_TREE)
|
||||
{
|
||||
t = groktypename (build_decl_list (specs, NULL_TREE));
|
||||
t = groktypename (build_decl_list (strip_attrs (specs),
|
||||
NULL_TREE));
|
||||
|
||||
if (t == NULL_TREE)
|
||||
{
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
// Build don't link:
|
||||
|
||||
struct T {
|
||||
struct S __attribute__ ((packed)) { // ERROR - parse error
|
||||
int i;
|
||||
};
|
||||
}; // ERROR - parse error
|
|
@ -0,0 +1,10 @@
|
|||
// Build don't link:
|
||||
|
||||
template <class T> void f1()
|
||||
{
|
||||
struct foo { enum T2 {
|
||||
un, du, toi };
|
||||
};
|
||||
}
|
||||
|
||||
void f2() { f1<int>(); }
|
Loading…
Reference in New Issue