Closed
Description
_Alignas(int) struct T {
int i;
};
gives the diagnostic: warning: attribute '_Alignas' is ignored, place it after "struct" to apply attribute to type declaration
which seems like a really helpful message at first glance. However, C does not allow you to put an _Alignas
specifier on the struct type itself. So following that advice:
struct _Alignas(int) T {
int i;
};
gives: error: declaration of anonymous struct must be a definition
and warning: declaration does not declare anything
.
The original diagnostic should say the attribute is ignored without the helpful message about placement (which is correct for C++).