re PR c++/45112 (Aligned attribute on static class member definition ignored)

gcc/
	PR c++/45112
	* cp/decl.c (duplicate_decls): Merge DECL_USER_ALIGN and DECL_PACKED.

gcc/testsuite/
	PR c++/45112
	* testsuite/g++.dg/pr45112.C: New test.

From-SVN: r162716
This commit is contained in:
Ulrich Weigand 2010-07-30 15:49:34 +00:00 committed by Ulrich Weigand
parent f0fc0803ea
commit 88d787e7a0
4 changed files with 26 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2010-07-30 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
PR c++/45112
* cp/decl.c (duplicate_decls): Merge DECL_USER_ALIGN and DECL_PACKED.
2010-07-30 Jakub Jelinek <jakub@redhat.com>
PR debug/45055

View File

@ -2113,6 +2113,10 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
SET_DECL_INIT_PRIORITY (olddecl, DECL_INIT_PRIORITY (newdecl));
DECL_HAS_INIT_PRIORITY_P (olddecl) = 1;
}
/* Likewise for DECL_USER_ALIGN and DECL_PACKED. */
DECL_USER_ALIGN (olddecl) = DECL_USER_ALIGN (newdecl);
if (TREE_CODE (newdecl) == FIELD_DECL)
DECL_PACKED (olddecl) = DECL_PACKED (newdecl);
/* The DECL_LANG_SPECIFIC information in OLDDECL will be replaced
with that from NEWDECL below. */

View File

@ -1,3 +1,8 @@
2010-07-30 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
PR c++/45112
* testsuite/g++.dg/pr45112.C: New test.
2010-07-30 Jakub Jelinek <jakub@redhat.com>
PR debug/45055

View File

@ -0,0 +1,12 @@
/* { dg-do compile } */
struct JSString
{
unsigned char mLength;
static JSString unitStringTable[];
};
JSString JSString::unitStringTable[] __attribute__ ((aligned (8))) = { 1 };
int bug [__alignof__ (JSString::unitStringTable) >= 8 ? 1 : -1];