[llvm] [Support] Do not ignore unterminated open { in formatv (PR #104688)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 19 04:27:24 PDT 2024


================
@@ -107,15 +107,18 @@ formatv_object_base::splitLiteralAndReplacement(StringRef Fmt) {
       StringRef Right = Fmt.drop_front(NumEscapedBraces * 2);
       return std::make_pair(ReplacementItem{Middle}, Right);
     }
-    // An unterminated open brace is undefined.  We treat the rest of the string
-    // as a literal replacement, but we assert to indicate that this is
-    // undefined and that we consider it an error.
+    // An unterminated open brace is undefined. Assert to indicate that this is
+    // undefined and that we consider it an error. When asserts are disabled,
+    // built a replacement item with an error message.
----------------
jurahul wrote:

Fixed, thanks.

https://github.com/llvm/llvm-project/pull/104688


More information about the llvm-commits mailing list