[llvm-dev] Why aren't the DenseSet Iterator dereference operators const?

Hamza Sood via llvm-dev llvm-dev at lists.llvm.org
Tue Jan 3 08:11:41 PST 2017


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>


More information about the llvm-dev mailing list