+2012-05-25 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/32054
+ * parser.c (cp_parser_member_declaration): A storage class is not
+ allowed in a declaration of an anonymous aggregate in a class scope.
+
2012-05-24 Uros Bizjak <ubizjak@gmail.com>
PR obj-c++/53441
particular type), as opposed to a nested class. */
else if (ANON_AGGR_TYPE_P (type))
{
+ /* C++11 9.5/6. */
+ if (decl_specifiers.storage_class != sc_none)
+ error_at (decl_spec_token_start->location,
+ "a storage class on an anonymous aggregate "
+ "in class scope is not allowed");
+
/* Remove constructors and such from TYPE, now that we
know it is an anonymous aggregate. */
fixup_anonymous_aggr (type);
+2012-05-25 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/32054
+ * g++.dg/other/anon-union3.C: New.
+
2012-05-25 Ian Lance Taylor <iant@google.com>
* gcc.dg/split-6.c: New test.
--- /dev/null
+// PR c++/32054
+
+class C
+{
+ auto union // { dg-error "storage class" "" { target c++98 } }
+ {
+ int a;
+ }; // { dg-error "multiple|specified" "" { target c++11 } }
+ register union // { dg-error "storage class" }
+ {
+ int b;
+ };
+ static union // { dg-error "storage class" }
+ {
+ int c;
+ };
+ extern union // { dg-error "storage class" }
+ {
+ int d;
+ };
+ mutable union // { dg-error "storage class" }
+ {
+ int e;
+ };
+};