[llvm] [DenseMap] Work around a MSVC bug in lookup_or (PR #142268)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 1 02:11:47 PDT 2025


================
@@ -226,6 +226,12 @@ class DenseMapBase : public DebugEpochBase {
     return Default;
   }
 
+  ValueT lookup_or(const_arg_type_t<KeyT> Val, const ValueT &Default) const {
----------------
artagnon wrote:

I'm not sure how to test this, as I don't have a Windows machine, and the Windows CI isn't configured the same way as the Buildbot that failed. Wasn't the error `C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\lib\Analysis\ScalarEvolution.cpp(15907): note: You cannot bind an lvalue to an rvalue reference`? If I understand correctly, MSVC has its own version of STL, so what you proposed might not work.

https://github.com/llvm/llvm-project/pull/142268


More information about the llvm-commits mailing list