Commit ed29e24b by Martin Sebor Committed by Martin Sebor

PR c++/38611 - missing -Wattributes on a typedef with attribute aligned

From-SVN: r236112
parent c8acbe37
2016-05-10 Martin Sebor <msebor@redhat.com>
PR c++/38611
* g++.dg/Wattributes.C: New test.
2016-05-10 Marc Glisse <marc.glisse@inria.fr>
* gcc.dg/tree-ssa/bit-assoc.c: New testcase.
......
// PR c++/38611
// { dg-do compile }
struct A { unsigned char a [272]; };
typedef struct __attribute__ ((aligned (128))) A B; // { dg-warning "attributes ignored" }
typedef struct __attribute__ ((__may_alias__)) A C; // { dg-warning "attributes ignored" }
#ifndef __cplusplus
# define alignof _Alignof
# define static_assert _Static_assert
#elif __cplusplus < 201103L
# define alignof __alignof__
# define static_assert(expr, ignore) typedef int Assert [(expr) ? 1 : -1]
#endif
#define SA(expr) static_assert ((expr), #expr)
SA (alignof (struct A) == alignof (B));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment