================
@@ -17,11 +17,29 @@
#include "clang/AST/ASTContext.h"
#include "clang/AST/FormatString.h"
#include "clang/AST/Type.h"
+#include "clang/Basic/TargetInfo.h"
+#include "llvm/Support/TextEncoding.h"
namespace clang {
class LangOptions;
+/// Creates a TextEncodingConverter for format string character comparisons.
+/// On z/OS format strings are IBM-1047 encoded, so each byte must be converted
----------------
hubert-reinterpretcast wrote:
> Traversing the source string would be complicated because it may consist of
> multiple concatenated pieces, contain escape sequences etc.
I was not advocating for traversal of the source string (after all, numeric
escape sequences would need to be interpreted as well). I was suggesting that
the format string be processed in the literal encoding (i.e., by iterating
through multibyte characters until `%` is encountered and then parsing the
conversion specification by matching byte values for the flags, etc., as they
are in the literal encoding). That way, the `[` conversion specifier would be
handled in a manner consistent with the wording of the C standard.
https://github.com/llvm/llvm-project/pull/196568
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits