[PATCH] D100670: [ADT] Add makeVisitor to STLExtras.h

Scott Linder via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 1 11:16:02 PDT 2021


scott.linder added inline comments.


================
Comment at: llvm/unittests/ADT/STLExtrasTest.cpp:834
+    EXPECT_EQ(Visitor(2.f), 4.f);
+    EXPECT_EQ(Visitor(2.), "unhandled type");
+    EXPECT_EQ(Visitor(Visitor), "unhandled type");
----------------
(Accidentally posted this on the commit itself first, reposting here)

Ah, I believe my mistake was assuming EXPECT_EQ treated char * as a string, rather than like any other pointer. I didn't intend to compare the pointer values here, but it accidentally succeeds when the compiler merges the storage for both string literals.

I'll have a patch up shortly to fix the bug.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100670



More information about the llvm-commits mailing list