[PATCH] D123901: [LLVM][Casting.h] Allow dyn_cast to return Optional for types that are not constructble from nullptr.

Dawid Jurczak via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 17 04:51:46 PDT 2022


yurai007 added inline comments.


================
Comment at: llvm/unittests/Support/Casting.cpp:214
+TEST(CastingTest, dyn_cast_or_none) {
+  Optional<bar> empty{};
+  Optional<foo> F1 = dyn_cast_or_none<foo>(empty);
----------------
I guess braces are redundant here.


================
Comment at: llvm/unittests/Support/Casting.cpp:220
+  EXPECT_TRUE(F2.hasValue());
+}
+
----------------
Missing test cases for pointer overloads?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123901



More information about the llvm-commits mailing list