<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Sep 18, 2014, at 9:33 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;"><br><div><div>On Sep 17, 2014, at 5:42 PM, David Majnemer <<a href="mailto:david.majnemer@gmail.com">david.majnemer@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Author: majnemer<br>Date: Wed Sep 17 19:42:05 2014<br>New Revision: 218006<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=218006&view=rev">http://llvm.org/viewvc/llvm-project?rev=218006&view=rev</a><br>Log:<br>Sema: Diagnose undefined structs used as Microsoft anonymous structs<br><br>Previously, we would not mark structs containing anonymous structs as<br>invalid. Later, horrific things would occur when trying to determine<br>the size of the parent record.<br><br>Instead, require the struct to be a complete type when used as an<br>anonymous struct. Mark both the anonymous field for the struct and the<br>parent context as invalid (this is similar to what we do when a struct<br>contains a field with an incomplete type.)<br></blockquote></div><br><div><br></div><div>Thank you David for working on this. Will this test case continue to work without error. This was the behavior before:</div></div></blockquote><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">struct anon_fault {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space:pre"> </span>struct undefined;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">};</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;">struct undefined {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"> int ii;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">};</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 anon_fault);</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></blockquote><div><br></div>We get the error with your patch:</div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><b>t.c:2:2: </b><span style="color: #c33720"><b>error: </b></span><b>field has incomplete type 'struct undefined'</b></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><b>t.c:2:9: note: </b>forward declaration of 'struct undefined'</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"> struct undefined;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(52, 189, 38);"><b> ^</b></div><div style="margin: 0px;"><b><font color="#34bd26" face="Menlo"><span style="font-size: 11px;">I am not familiar with details of microsoft’s anonymous structs. Is this the expected behavior?</span></font></b></div><div style="margin: 0px;"><b><font color="#34bd26" face="Menlo"><span style="font-size: 11px;"><br></span></font></b></div><div style="margin: 0px;"><b><font color="#34bd26" face="Menlo"><span style="font-size: 11px;">- Thanks, Fariborz</span></font></b></div><div style="margin: 0px;"><b><font color="#34bd26" face="Menlo"><span style="font-size: 11px;"><br></span></font></b></div></div><div><br></div><br></body></html>