re PR c/11446 ([3.4][3.4 regression?] Incompatibilty with alignment of structures between 3.3 and 3.4 CVS)

PR c/11446
        * stor-layout.c (layout_decl): Fix alignment handling.

From-SVN: r72725
This commit is contained in:
Jason Merrill 2003-10-20 18:01:58 -04:00
parent 2038bd6935
commit 73f079427d

View File

@ -0,0 +1,19 @@
/* PR c/11446: packed on a struct takes precedence over aligned on the type
of a field. */
/* { dg-do run } */
struct A {
double d;
} __attribute__ ((aligned));
struct B {
char c;
struct A a;
} __attribute__ ((packed));
int main ()
{
if (sizeof (struct B) != sizeof (char) + sizeof (struct A))
abort ();
return 0;
}