From 6555674b1881592e377ea0d64caa9ea184139227 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 9 Dec 2024 14:53:02 +0100 Subject: [PATCH] strlen optimization: use constexpr instead of runtime-constant strlen cannot be a constexpr in all platforms otherwise. --- lib/Interpreter/ForwardDeclPrinter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Interpreter/ForwardDeclPrinter.cpp b/lib/Interpreter/ForwardDeclPrinter.cpp index 1752ef2844..5b2e61303d 100644 --- a/lib/Interpreter/ForwardDeclPrinter.cpp +++ b/lib/Interpreter/ForwardDeclPrinter.cpp @@ -192,7 +192,7 @@ namespace cling { // FIXME: Once the C++ modules replaced the forward decls, remove this. if (D->getASTContext().getLangOpts().Modules && llvm::StringRef(includeText).starts_with("include ")) { - includeText += strlen("include "); + includeText += std::char_traits::length("include "); } assert((includeText[0] == '<' || includeText[0] == '"') &&