[cfe-dev] Compile errors with MSVC 2005 (SVN revision 53516)

Ted Kremenek kremenek at apple.com
Sat Jul 12 09:53:36 PDT 2008

On Jul 12, 2008, at 8:58 AM, C├ędric Venet wrote:

>> Hello,
>> Compiling SVN revision 53516 with MSVC 2005 results in many compile
>> errors similar to this one:
>> [...]
>> I'm using the llvm/win32/clang.sln project to build clang. Is this  
>> the
>> correct way to do so?
> Yes, but llvm is broken for VC2005 it seems.
> In llvm/adt/alist.h:
> There is two constructor and in some case VS complain
>  alist_iterator(NodeIterT NI) : NodeIter(NI) {}
>  alist_iterator(pointer EP) : NodeIter(NodeTy::getNode(EP)) {}
> at first I was thinking it was because NodeIterT and pointer  
> resolved to the
> same type but doing some metaprogramming to remove one of the  
> constructor in
> this special case don't seems to work. In fact it seems they never  
> are the
> same type. So I don't understand what is the problem. And the error  
> message
> don't have the type nor the position of the instantiation error...  
> really
> strange.
> I suppose you can try to revert llvm to previous 53209 (53210 added  
> the file
> on july, 8th), it should/may work. It seems Ted Kremenek compiled it  
> ok with
> one unknow version of VS. Ted? Was is VS2008 or VS2005sp1 or has it  
> been
> broken since rev53432?

I've seen this problem as well.  I encountered a series of VC++ errors  
with alist and ilist with regards to typedefs being private (and fixed  
those), but I hit this same problem and was still in the process of  
diagnosing it.  I didn't have a chance to dive into this further on  
Friday or today because I am away from a Windows machine.  I am using  
VS 2005.

FWIW, VC++ has far more limited template support than GCC does.  When  
I was writing the serialization library (for generic object  
serialization; this is used in Clang), I had to be careful of the use  
of things like member templates in templated classes because I would  
hit weird limitations with VC++.  It's entirely possible that parts of  
alist need to be rewritten in order for it to work on VC++.

The changes to (or rather the creation of) alist I think are very  
recent (I believe this is Dan Gohman's work).  I've CC'ed him on this  
message in case he has any ideas of what an easy fix would be, since  
he's the one most familiar with that code.

More information about the cfe-dev mailing list