PR lto/84212 - -Wno-* does not disable warnings from -flto link stage
[official-gcc.git] / gcc / testsuite / g++.dg / pr53037-4.C
blob553dd9a6c45e88e3b283c06f1bac59e442197132
1 /* PR c/53037.  */
2 /* { dg-do compile } */
3 /* { dg-options "-O0" } */
5 int foo1 __attribute__((warn_if_not_aligned(8))); /* { dg-error "'warn_if_not_aligned' may not be specified for 'foo1'" } */
7 __attribute__((warn_if_not_aligned(8)))
8 void
9 foo2 (void) /* { dg-error "'warn_if_not_aligned' may not be specified for 'void foo2\\(\\)'" } */
13 struct foo3
15   int i : 2 __attribute__((warn_if_not_aligned(8))); /* { dg-error "'warn_if_not_aligned' may not be specified for 'i'" } */
18 typedef unsigned int __u32
19   __attribute__((aligned(4),warn_if_not_aligned(8)));
21 struct foo4
23   __u32 i : 2; /* { dg-error "cannot declare bit-field 'i' with 'warn_if_not_aligned' type" } */