summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/class.c1
-rw-r--r--gcc/testsuite/g++.dg/ext/attrib52.C15
3 files changed, 19 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 4a696675471..60a00aa17bc 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,8 @@
2015-06-26 Jason Merrill <jason@redhat.com>
+ PR c++/66216
+ * class.c (finish_struct): Call fixup_attribute_variants.
+
PR c++/66067
* mangle.c (write_template_args): Handle 0 length TREE_VEC.
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 9f189fb5eaf..12e62dff177 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -6825,6 +6825,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. */
diff --git a/gcc/testsuite/g++.dg/ext/attrib52.C b/gcc/testsuite/g++.dg/ext/attrib52.C
new file mode 100644
index 00000000000..e33556c9798
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/attrib52.C
@@ -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)));