[PATCH] D25587: Introduce llvm FormatVariadic

Bob Haarman via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 14 14:19:18 PDT 2016


inglorion added inline comments.


================
Comment at: include/llvm/Support/FormatVariadic.h:144
+
+// Format output.  `Fmt` is a string consisting of one or more replacement
+// sequences whose format is as follows:
----------------
We should probably also document here how one gets literal braces.


================
Comment at: unittests/Support/FormatVariadicTest.cpp:42
+
+  // An odd number 2*N+1 of braces should be replaced with N+1 braces when the
+  // last brace is not part of a replacement pattern.  This will occur as two
----------------
I would be more comfortable if we treated single, unbalanced braces as errors. If we specify a brace as starting a replacement pattern and a double brace as the specifier of a literal brace, the meaning of something like "{0"  is undefined and it's not clear what behavior was intended. Is there a way we report this to the programmer, so that they can fix it to be "{{0" or "{0}" or whatever they really meant?


https://reviews.llvm.org/D25587





More information about the llvm-commits mailing list