Namespaces
Variants
Views
Actions

Talk:cpp/language/alignas

From cppreference.com

Regarding this line:

"but alignments that are not used because they are weaker than natural alignment or weaker than another alignas on the same declaration are simply ignored. "

I'm not sure that this is true. I believe that alignments weaker than the natural alignment still cause the program to be ill-formed. While DR 2027 changed the wording of some of 7.6.2, I don't think it changed 7.6.2 Paragraph 5, which states:

"The combined effect of all alignment-specifiers in a declaration shall not specify an alignment that is less strict than the alignment that would be required for the entity being declared if all alignment-specifiers were omitted (including those in other declarations)." --Cbadger (talk) 12:06, 1 February 2016 (PST)

you're right, when I was appyling 2027, I missed the point being "no diagnostic is required for an insufficiently-strict alignment if a more stringent requirement is also supplied.". --Cubbi (talk)