<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Nov 4, 2013 at 11:14 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><div class="h5"><br>
<div><div>On Nov 4, 2013, at 11:13, David Majnemer <<a href="mailto:david.majnemer@gmail.com" target="_blank">david.majnemer@gmail.com</a>> wrote:</div><br><blockquote type="cite"><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><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:inherit;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:inherit;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:inherit;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:inherit;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:inherit;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:inherit;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></blockquote></div><div><br></div></div></div><div>Right, but in C++?</div><br><div>...actually, it seems that we <i>do</i> accept this in C++ (before and after your patch). Does GCC?</div></div></blockquote><div><br>
</div><div>Yes, with the following diagnostic under -pedantic:</div><div><br></div><div>warning: ISO C++ forbids zero-size array ‘b’ [-Wpedantic]<br></div><div> </div><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"><span class=""><font color="#888888"><div><br></div><div>Jordan</div></font></span></div>
</blockquote></div><br></div></div>