<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Implementation says that it is intentional:<div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span style="color: #000000">  </span>// The maximum field alignment overrides the aligned attribute.</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(79, 129, 135);"><span style="color: #000000">  </span><span style="color: #bb2ca2">if</span><span style="color: #000000"> (!</span>MaxFieldAlignment<span style="color: #000000">.</span><span style="color: #31595d">isZero</span><span style="color: #000000">()) {</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    FieldAlign = <span style="color: #703daa">std</span>::<span style="color: #3d1d81">min</span>(FieldAlign, <span style="color: #4f8187">MaxFieldAlignment</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    UnpackedFieldAlign = <span style="color: #703daa">std</span>::<span style="color: #3d1d81">min</span>(UnpackedFieldAlign, <span style="color: #4f8187">MaxFieldAlignment</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">  }</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">- Fariborz</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><br></div><div><div>On Jul 22, 2014, at 11:04 AM, jahanian <<a href="mailto:fjahanian@apple.com">fjahanian@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">This test shows that alignas() is ignored when used with #pragma.<div>Is this intentional behavior?</div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">#pragma pack(push, 1)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">struct S1 { char a; short b; double c; alignas(32) double d; char e; double f; };</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">#pragma pack(pop)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">int main()</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">{</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"> return sizeof(struct S1);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">}</div></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">- Thanks, Fariborz</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><br></div></div>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev<br></blockquote></div><br></div></body></html>