Hamza Sood via llvm-dev
2017-Jan-03 16:11 UTC
[llvm-dev] Why aren't the DenseSet Iterator dereference operators const?
I ran into some build errors while compiling LLVM+Clang in Visual Studio. The compilation of tools/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp fails with the error: binary '*': no operator found which takes a left-hand operand of type 'const llvm::detail::DenseSetImpl<ValueT,llvm::DenseMap<ValueT,llvm::detail::DenseSetEmpty,ValueInfoT,llvm::detail::DenseSetPair<ValueT>>,ValueInfoT>::Iterator' (or there is no acceptable conversion). I checked include/llvm/ADT/DenseSet.h and the iterator dereference operator isn't const, which explains why it can't find an operator* that takes a const iterator. The build completes successfully if I make the operator const (DenseSet.h lines 106 and 107). Is there a particular reason why it currently isn't const? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170103/fdef0cc7/attachment.html>