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

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 2 08:10:06 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 {
----------------
kazutakahirata wrote:

Perhaps you can try a mock-up version of `DenseMap::lookup_or` in Compiler Explorer or something!?  After that, I'd rely on the CI and buildbots.

The `template <typename U = std::remove_cv_t<ValueT> >` trick should be part of the C++ standard, not specific to a specific implementation of the standard.


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


More information about the llvm-commits mailing list