From: Jason Merrill Date: Fri, 26 Jun 2015 21:31:13 +0000 (-0400) Subject: re PR c++/66216 (Defaulted Operators and constructors not working with aligned attribute) X-Git-Tag: upstream/12.2.0~53914 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e0ff153d398cdeb1864aa64f0045091c8bb2de98;p=platform%2Fupstream%2Fgcc.git re PR c++/66216 (Defaulted Operators and constructors not working with aligned attribute) PR c++/66216 * class.c (finish_struct): Call fixup_attribute_variants. From-SVN: r225087 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5bfebe2..719ba06 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2015-06-26 Jason Merrill + 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. diff --git a/gcc/cp/class.c b/gcc/cp/class.c index f4e4f85..be31de2 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -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 index 0000000..e33556c --- /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)));