[PATCH] D139973: [llvm] Make llvm::Any similar to std::any

Sebastian Neubauer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 19 08:33:31 PST 2022


sebastian-ne added inline comments.


================
Comment at: lldb/include/lldb/Core/RichManglingContext.h:90-91
     assert(parser.has_value());
-    assert(llvm::any_isa<ParserT *>(parser));
+    assert(llvm::any_cast<ParserT *>(&parser));
     return llvm::any_cast<ParserT *>(parser);
   }
----------------
barannikov88 wrote:
> This is not intuitively clear. In assert you pass an address, but in 'return' below the object is passed by reference.
> 
I changed it to use an address + explicit dereference in the return. I hope that makes it clearer.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139973



More information about the cfe-commits mailing list