[PATCH] D103426: Clang: Extend format string checking to wprintf/wscanf

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 21 12:52:27 PDT 2021


aaron.ballman added inline comments.


================
Comment at: clang/lib/AST/OSLog.cpp:212
+  } else if (Lit->isUTF16()) {
+    std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> Convert;
+    std::u16string U16 = Lit->getStringAsChar16();
----------------
cor3ntin wrote:
> I'm not sure I have a better suggestion but `codecvt_utf8_utf16` is deprecated in C++17
Good point -- this likely should be lifted into a common interface (as it appears several times in the patch) and make use of the existing LLVM UTF conversion functionality: https://github.com/intel/llvm/blob/sycl/llvm/include/llvm/Support/ConvertUTF.h


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103426/new/

https://reviews.llvm.org/D103426



More information about the cfe-commits mailing list