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>
<div><br></div><div>Can this check be relaxed a bit meanwhile so Clang can parse libraries that make use of those forward declared member pointers?</div><div><br></div><div><br></div>-- <br>João Matos