================
@@ -17928,43 +17928,70 @@ std::optional<std::string> 
Expr::tryEvaluateString(ASTContext &Ctx) const {
   return {};
 }
 
-bool Expr::EvaluateCharRangeAsString(std::string &Result,
-                                     const Expr *SizeExpression,
-                                     const Expr *PtrExpression, ASTContext 
&Ctx,
-                                     EvalResult &Status) const {
-  LValue String;
-  EvalInfo Info(Ctx, Status, EvalInfo::EM_ConstantExpression);
-  Info.InConstantContext = true;
+template <typename T>
+static bool EvaluateCharRangeAsStringImpl(const Expr*, T& Result,
+                                          const Expr *SizeExpression,
+                                          const Expr *PtrExpression, 
ASTContext &Ctx,
+                                          Expr::EvalResult &Status) {
+    LValue String;
+    EvalInfo Info(Ctx, Status, EvalInfo::EM_ConstantExpression);
+    Info.InConstantContext = true;
 
-  FullExpressionRAII Scope(Info);
-  APSInt SizeValue;
-  if (!::EvaluateInteger(SizeExpression, SizeValue, Info))
-    return false;
+    FullExpressionRAII Scope(Info);
----------------
erichkeane wrote:

What weirdness is going on with the formatting here?

https://github.com/llvm/llvm-project/pull/131003
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to