[PATCH] D151079: [llvm][ADT] Change isEqual for DenseMapInfo<std::variant<...>>

Kadir Cetinkaya via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 23 07:53:02 PDT 2023


kadircet marked an inline comment as done.
kadircet added inline comments.


================
Comment at: llvm/unittests/ADT/DenseMapTest.cpp:739-740
             DenseMapInfo<variant>::getHashValue(Keys[1]));
+  EXPECT_TRUE(DenseMapInfo<variant>::isEqual(Keys[0], Keys[0]));
+  EXPECT_FALSE(DenseMapInfo<variant>::isEqual(Keys[0], Keys[1]));
 }
----------------
IncludeGuardian wrote:
> It is worth testing a type were `isEqual` and `operator==` disagree? The tombstone and empty keys in `StringRef` would be an example where they don't work with `operator==` https://github.com/llvm/llvm-project/blob/a68bbf42fa680c7159165be8915d73e012c50f96/llvm/include/llvm/ADT/StringRef.h#L911-L931
i'd rather not depend on the implementation details for DenseMapInfo<StringRef>, added a custom type into the test instead.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151079/new/

https://reviews.llvm.org/D151079



More information about the llvm-commits mailing list