]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR c++/66216
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 26 Jun 2015 21:31:13 +0000 (21:31 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 26 Jun 2015 21:31:13 +0000 (21:31 +0000)
* class.c (finish_struct): Call fixup_attribute_variants.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225087 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/testsuite/g++.dg/ext/attrib52.C [new file with mode: 0644]

index 5bfebe2359f121bc85943a3d1a0997dcbc52fe1b..719ba06b346ffb7748c3a804e56f75f946f80ed8 100644 (file)
@@ -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++/66684
        * typeck2.c (merge_exception_specifiers): Allow different
        noexcept-specifiers if we've had errors.
index f4e4f8588e15876e4c937108825b744f0638270e..be31de21d3bd4b74879d2553bab8a42c5137ca5b 100644 (file)
@@ -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.  */
diff --git a/gcc/testsuite/g++.dg/ext/attrib52.C b/gcc/testsuite/g++.dg/ext/attrib52.C
new file mode 100644 (file)
index 0000000..e33556c
--- /dev/null
@@ -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)));