Open Quuxplusone opened 9 years ago
After further investigation, it seems that there should be a conversion
available from
DenseMapIterator<KeyT,ValueT,KeyInfoT,BucketT,false> to
DenseMapIterator<KeyT,ValueT,KeyInfoT,BucketT,true>
I don't know why it is not chosen here, the comments tell about some SFINAE
taking place here I don't see how but maybe that's the reason since VS doesn't
support SFINAE?
After a few more tests, it appears that the problem lies indeed in the fact
that the constructor DenseMap<true>(const DenseMap<false>&) is not accessible.
This can be tested by trying to create a DenseMap::const_iterator from a
DenseMap::iterator.
Interestingly enough, when I try this exact same operation elsewhere in the
code (for example in AArch64AddressTypePromotion.cpp, where a DenseMap<Value *,
Instruction *> is used) it functions as expected...
When trying to compile clang with Visual Studio 2015 preview, I get the following error when compiling RecordLayoutBuilder.cpp (in clangAST) :
RecordLayoutBuilder.cpp(2981) error C2678: binary '==': no operator found which takes a left-hand operand of type 'llvm::DenseMapIterator<KeyT,ValueT,KeyInfoT,BucketT,false>' (or there is no acceptable conversion) (...) while trying to match the argument list '(llvm::DenseMapIterator<KeyT,ValueT,KeyInfoT,BucketT,false>, llvm::DenseMapIterator<KeyT,ValueT,KeyInfoT,BucketT,false>)'
The compiler seem to complain because the egality-comparison operator is only defined for RHS maps of type llvm::DenseMapIterator<KeyT,ValueT,KeyInfoT,BucketT,true>
I have solved the problem by replacing the comparison operator in DenseMap.h, lines 1039-1054 so that they can take input of any DenseMapIterator, not only ConstIterator.