<div dir="ltr"><div>Thanks so much for the quick response David.</div><div>I have reported this as a bug on GCC's bug tracker:<a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118117">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118117</a></div><div><br></div><div>I tried it on clang and I don't see the same behavior. So it does seem to be pointing to an issue in GCC...</div><div><br></div><div>Thanks</div><div>Lorenzo<br></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, Dec 18, 2024 at 1:26 PM David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">This is probably more of a question for the DWARF producer, like GCC, than the DWARF workgroup, but let's take a look anyway... <br><br>Ah, OK, simplifying things down a bit. You've got this case:<br>```<br>struct t1<br>{<br> typedef struct<br> {<br> } t2;<br><br>#ifdef USE_VIRTUAL<br> virtual void f1();<br>#endif<br>};<br><br>t1::t2 v1<br>#ifdef USE_ARRAY<br>[1]<br>#endif<br>;<br>```<br>And the observed behavior of GCC is that the type of `v1` is (potentially array-of) "t1::(anonymous struct)" if USE_VIRTUAL && USE_ARRAY, and otherwise the type is "t1::t2"<br><br>Yeah, seems to be the case ( <a href="https://godbolt.org/z/c19PrPx83" target="_blank">https://godbolt.org/z/c19PrPx83</a> ). I'd guess it's just a minor bug in GCC - seems to still be there today/trunk.<br><br>The inconsistency seems to point to it being a bug, and that the expected behavior would be that the type is `t1::t2` even if it's an array and t1 has virtual functions.</div></div>
</blockquote></div>