================
@@ -775,6 +775,11 @@ class Expr : public ValueStmt {
const Expr *PtrExpression, ASTContext &Ctx,
EvalResult &Status) const;
+ /// If the current Expr can be evaluated to a pointer to a null-terminated
+ /// constant string, return the constant string (without the terminating
null)
+ /// in Result. Return true if it succeeds.
+ bool tryEvaluateString(std::string &Result, ASTContext &Ctx) const;
----------------
delcypher wrote:
Nit: Returning `std::optional<std::string>` might be a cleaner API to provide.
https://github.com/llvm/llvm-project/pull/79230
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits