commit ffea563209dfc6daf1054fffc6f8d726e440f1dc
Author: Jason Merrill <jason@redhat.com>
Date: Fri Jun 26 16:52:01 2015 -0400
PR c++/66216
* class.c (finish_struct): Call fixup_attribute_variants.
@@ -6820,6 +6820,7 @@ finish_struct (tree t, tree attributes)
unreverse_member_declarations (t);
cplus_decl_attributes (&t, attributes, (int) ATTR_FLAG_TYPE_IN_PLACE);
+ fixup_attribute_variants (t);
/* Nadger the current location so that diagnostics point to the start of
the struct, not the end. */
new file mode 100644
@@ -0,0 +1,15 @@
+// PR c++/66216
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
+
+class CMymy
+{
+ unsigned char _a;
+ unsigned char _b;
+public:
+ constexpr CMymy() : _a(), _b() {}
+
+ constexpr CMymy(const CMymy &) = default;
+ CMymy &operator=(const CMymy &) = default;
+
+} __attribute__((aligned(2)));