* 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
+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,
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 ();
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)
{
--- /dev/null
+// Build don't link:
+
+struct T {
+ struct S __attribute__ ((packed)) { // ERROR - parse error
+ int i;
+ };
+}; // ERROR - parse error
--- /dev/null
+// Build don't link:
+
+template <class T> void f1()
+{
+ struct foo { enum T2 {
+ un, du, toi };
+ };
+}
+
+void f2() { f1<int>(); }