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:
Mark Mitchell 1998-08-31 23:38:02 +00:00 committed by Mark Mitchell
parent 2571e6acfa
commit 9360ac70ad
5 changed files with 29 additions and 2 deletions

View File

@ -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,

View File

@ -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 ();

View File

@ -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)
{

View File

@ -0,0 +1,7 @@
// Build don't link:
struct T {
struct S __attribute__ ((packed)) { // ERROR - parse error
int i;
};
}; // ERROR - parse error

View File

@ -0,0 +1,10 @@
// Build don't link:
template <class T> void f1()
{
struct foo { enum T2 {
un, du, toi };
};
}
void f2() { f1<int>(); }