<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Oct 31, 2012, at 13:53 , John McCall <<a href="mailto:rjmccall@apple.com">rjmccall@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">On Oct 31, 2012, at 12:37 PM, David Blaikie wrote:<br><blockquote type="cite">GCC 4.7 mangles them as:<br><br>_Z1fIN1SUt_EEiT_<br>_Z1fIN1SUt0_EEiT_<br>_Z1fIN1TUt_EEiT_<br>_Z1fIN1TUt0_EEiT_<br><br>I don't think we have any class-specific unnamed nested type counter<br>that would implement that Ut_, Ut0_, ... mangling scheme, though I can<br>imagine where one might be added (I'm not very familiar with IRGen<br>though, so I'll certainly be happy to have any pointers about how that<br>could/should be implemented).<br></blockquote><br>Probably we would want to record and remember this in the AST.<br><br>This schema is indeed the one blessed by the ABI.<br>   <unnamed-type-name> ::= Ut [ <nonnegative number> ] _<br>But as the ABI also notes:<br>  The mangling of such unnamed types defined in namespace scope is generally unspecified because they do not have to match across translation units. An implementation must only ensure that naming collisions are avoided.<br></blockquote></div><br><div>But David's original example does not have an unnamed type in namespace scope.</div><div><br></div><div><blockquote type="cite"><span style="font-family: Menlo-Regular; font-size: 11px;">struct foo {</span><br style="font-family: Menlo-Regular; font-size: 11px;"><span style="font-family: Menlo-Regular; font-size: 11px;"> struct {</span><br style="font-family: Menlo-Regular; font-size: 11px;"><span style="font-family: Menlo-Regular; font-size: 11px;">   void func() { ... } // warning that this is 'unused'</span><br style="font-family: Menlo-Regular; font-size: 11px;"><span style="font-family: Menlo-Regular; font-size: 11px;"> } x;</span><br style="font-family: Menlo-Regular; font-size: 11px;"><span style="font-family: Menlo-Regular; font-size: 11px;">};</span><br style="font-family: Menlo-Regular; font-size: 11px;"></blockquote></div></body></html>