<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Mar 12, 2013, at 3:33 PM, Joćo Matos <<a href="mailto:ripzonetriton@gmail.com">ripzonetriton@gmail.com</a>> wrote:</div><blockquote type="cite">On Fri, Jan 25, 2013 at 10:30 PM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com" target="_blank">rjmccall@apple.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

-  // In the Microsoft ABI, the class is allowed to be an incomplete<br>
-  // type. In such cases, the compiler makes a worst-case assumption.<br>
-  // We make no such assumption right now, so emit an error if the<br>
-  // class isn't a complete type.<br>
-  if (Context.getTargetInfo().getCXXABI() == CXXABI_Microsoft &&<br>
+  // C++ allows the class type in a member pointer to be an incomplete type.<br>
+  // In the Microsoft ABI, the size of the member pointer can vary<br>
+  // according to the class type, which means that we really need a<br>
+  // complete type if possible, which means we need to instantiate templates.<br>
+  //<br>
+  // For now, just require a complete type, which will instantiate<br>
+  // templates.  This will also error if the type is just forward-declared,<br>
+  // which is a bug, but it's a bug that saves us from dealing with some<br>
+  // complexities at the moment.<br>
+  if (Context.getTargetInfo().getCXXABI().isMicrosoft() &&<br>
       RequireCompleteType(Loc, Class, diag::err_incomplete_type))<br>
     return QualType()<br></blockquote></div><div><br></div><div>Hi John, this check prevents libraries like FastDelegates from being parsed in MSVC mode.</div><div><br></div><div>How hard is it to implement proper template instantiation like you explain in the comment?</div></blockquote><div><br></div>Shouldn't be hard at all;  I'm pretty positive we have other places that</div><div>need exactly this.  Look at the other users of RequireCompleteType</div><div>and find some other place that wants a complete type if possible but</div><div>permits an incomplete type.  I think that happens in e.g. ADL and</div><div>overload resolution.</div><div><br></div><div><blockquote type="cite"><div>Can this check be relaxed a bit meanwhile so Clang can parse libraries that make use of those forward declared member pointers?</div></blockquote></div><div><br></div><div>Nah, just fix it.</div><div><br></div><div>John.</div></body></html>