<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Nov 4, 2013 at 9:09 AM, Jordan Rose <span dir="ltr"><<a href="mailto:jordan_rose@apple.com" target="_blank">jordan_rose@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div class="im"><br><div>
<div>On Nov 2, 2013, at 3:38 , David Majnemer <<a href="mailto:david.majnemer@gmail.com" target="_blank">david.majnemer@gmail.com</a>> wrote:</div><br><blockquote type="cite"><span style="font-family:monospace;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">+                     : getLangOpts().CPlusPlus</span><br style="font-family:monospace;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<span style="font-family:monospace;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">+                           ? diag::ext_flexible_array_union_gnu</span><br style="font-family:monospace;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<span style="font-family:monospace;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">+                           : diag::err_flexible_array_union;</span><br style="font-family:monospace;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
</blockquote></div><br></div><div>This doesn't look right. Flexible array members in unions shouldn't be an extension in C++ if they're disallowed in C.</div></div></blockquote></div><br></div><div class="gmail_extra">
My patch doesn't change this behavior.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Given:</div><div class="gmail_extra">union x { int a; int b[]; };<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">
clang in c99 or c89:</div><div class="gmail_extra">error: field has incomplete type 'int []'<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">gcc in c99 or c89:</div><div class="gmail_extra">error: flexible array member in union</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">-- </div><div class="gmail_extra">David Majnemer</div></div>