[cfe-commits] r173514 - in /cfe/trunk: include/clang/Basic/TargetCXXABI.h include/clang/Basic/TargetInfo.h lib/AST/ASTContext.cpp lib/AST/RecordLayout.cpp lib/AST/RecordLayoutBuilder.cpp lib/AST/VTableBuilder.cpp lib/Basic/TargetInfo.cpp lib/Basic/Targets.cpp lib/CodeGen/CGClass.cpp lib/CodeGen/CGRecordLayoutBuilder.cpp lib/CodeGen/CodeGenModule.cpp lib/Sema/SemaType.cpp

João Matos ripzonetriton at gmail.com
Tue Mar 12 15:33:27 PDT 2013


On Fri, Jan 25, 2013 at 10:30 PM, John McCall <rjmccall at apple.com> wrote:

> -  // In the Microsoft ABI, the class is allowed to be an incomplete
> -  // type. In such cases, the compiler makes a worst-case assumption.
> -  // We make no such assumption right now, so emit an error if the
> -  // class isn't a complete type.
> -  if (Context.getTargetInfo().getCXXABI() == CXXABI_Microsoft &&
> +  // C++ allows the class type in a member pointer to be an incomplete
> type.
> +  // In the Microsoft ABI, the size of the member pointer can vary
> +  // according to the class type, which means that we really need a
> +  // complete type if possible, which means we need to instantiate
> templates.
> +  //
> +  // For now, just require a complete type, which will instantiate
> +  // templates.  This will also error if the type is just
> forward-declared,
> +  // which is a bug, but it's a bug that saves us from dealing with some
> +  // complexities at the moment.
> +  if (Context.getTargetInfo().getCXXABI().isMicrosoft() &&
>        RequireCompleteType(Loc, Class, diag::err_incomplete_type))
>      return QualType()
>

Hi John, this check prevents libraries like FastDelegates from being parsed
in MSVC mode.

How hard is it to implement proper template instantiation like you explain
in the comment?

Can this check be relaxed a bit meanwhile so Clang can parse libraries that
make use of those forward declared member pointers?


-- 
João Matos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130312/bf9d6dd4/attachment.html>


More information about the cfe-commits mailing list