+2002-04-23 Jakub Jelinek <jakub@redhat.com>
+
+ * parse.y (check_class_key): Allow KEY to be union/enum/struct/class
+ node with attributes.
+
2002-2-23 David O'Brien <obrien@FreeBSD.org>
* g++spec.c (MATH_LIBRARY_PROFILE, LIBSTDCXX_PROFILE): Add.
tree key;
tree aggr;
{
+ if (TREE_CODE (key) == TREE_LIST)
+ key = TREE_VALUE (key);
if ((key == union_type_node) != (TREE_CODE (aggr) == UNION_TYPE))
pedwarn ("`%s' tag used in naming `%#T'",
key == union_type_node ? "union"
+2002-04-23 Jakub Jelinek <jakub@redhat.com>
+
+ * g++.dg/parse/attr1.C: New test.
+
2002-04-23 Roger Sayle <roger@eyesopen.com>
* gcc.c-torture/execute/string-opt-17.c: New test case.
--- /dev/null
+// Test whether attributes are accepted both immediately after
+// struct/union keyword and after the closing brace.
+// { dg-do compile }
+
+struct foo
+{
+ union __attribute__ ((packed))
+ {
+ int a;
+ long b;
+ };
+ union __attribute__ ((packed)) __attribute__ ((unused))
+ {
+ int c;
+ long d;
+ };
+};
+
+union __attribute__ ((packed)) bar
+{
+ int c;
+ long d;
+};
+
+struct __attribute__ ((packed)) baz
+{
+ int e;
+ long f;
+};
+
+struct foo2
+{
+ union
+ {
+ int a;
+ long b;
+ } __attribute__ ((packed));
+};
+
+union bar2
+{
+ int c;
+ long d;
+} __attribute__ ((packed));
+
+struct baz2
+{
+ int e;
+ long f;
+} __attribute__ ((packed));