<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Nov 12, 2014 at 5:14 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Wed, Oct 29, 2014 at 2:26 PM, Tomasz Miąsko <span dir="ltr"><<a href="mailto:tomasz.miasko@gmail.com" target="_blank">tomasz.miasko@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have updated tests to include an anonymous union, an anonymous struct and<br>
combinations of those two. In addition, dependency on non-diagnosed incomplete<br>
type in member-expression has been removed.<br>
<br>
End condition is now made more explicit using IndirectFieldDecl, but this<br>
requires additional check ensuring that we are in fact dealing with an<br>
anonymous union / struct (so that we don't break non-anonymous case). Did you<br>
have something simpler in mind here?</blockquote><div><br></div></span><div>I was thinking of something like:</div><div><br></div><div>  while (base is anonymous struct or union) {</div><div>    base = cast<MemberExpr>(base->getBase());<br></div><div>    isArrow = base->isArrow();</div><div>  }</div><div><br></div><div>... but what you have here is fine</div></div></div></div></blockquote><div><br></div><div>Actually, scratch that. It looks like your approach will break if you change your testcase:</div><div><br></div><div>struct X {</div><div>  struct {</div><div>    int i;</div><div>  };</div><div>};</div><div><br></div><div>How about just</div><div><br></div><div>    if (!member)</div><div>      return mangleExpression(base);</div><div><br></div><div>?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>(especially since we don't have a nice way to write "is anonymous struct or union" for a type). Do you need someone to commit this for you?</div><span class=""><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
<a href="http://reviews.llvm.org/D5997" target="_blank">http://reviews.llvm.org/D5997</a><br>
<br>
Files:<br>
  lib/AST/ItaniumMangle.cpp<br>
  test/CodeGenCXX/mangle-exprs.cpp<br>
</div></div></blockquote></span></div><br></div></div>
</blockquote></div><br></div></div>