================
@@ -323,7 +326,32 @@ void UseAfterMoveFinder::getUsesAndReinits(
   });
 }
 
-static bool isStandardSmartPointer(const ValueDecl *VD) {
+static std::optional<StringRef> getStringLiteral(const Expr *E) {
+  if (!E)
+    return std::nullopt;
+  if (const auto *SL = dyn_cast<StringLiteral>(E->IgnoreParenImpCasts()))
----------------
juanvazquez wrote:

I think `dyn_cast_if_present` doesn't fit here bc I've to check if `E` is null 
before trying to use the pointer. And afaict `IgnoreParenImpCasts` wouldn't 
return null.
 
Kindly let me know if I'm misunderstanding the comment, or I'm missing 
something about `dyn_cast_if_present`. 
Likewise, it's a best practice for the codebase to just use 
`dyn_cast_if_present` anyways, and you prefer that, let me know.

https://github.com/llvm/llvm-project/pull/186903
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to