================
@@ -13288,9 +13288,23 @@ EvaluateComparisonBinaryOperator(EvalInfo &Info, const 
BinaryOperator *E,
     // Reject differing bases from the normal codepath; we special-case
     // comparisons to null.
     if (!HasSameBase(LHSValue, RHSValue)) {
-      auto DiagComparison = [&] (unsigned DiagID, bool Reversed = false) {
-        std::string LHS = LHSValue.toString(Info.Ctx, E->getLHS()->getType());
-        std::string RHS = RHSValue.toString(Info.Ctx, E->getRHS()->getType());
+      auto DiagComparison = [&](unsigned DiagID, bool Reversed = false) {
+        static std::string LHS, RHS;
----------------
AdvenamTacet wrote:

They are not const, but we update their value every time visiting the function. 
Assigning value is moved to the next line, which is executed every time.

It is a workaround, but I'm unsure if a good one. (However, it solved the 
problem with buildbots.)
Code suggested by @cor3ntin works as well for a reason I don't understand.
It's more confusing than I initially thought.

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

Reply via email to