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

Marcus Johnson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 29 19:28:29 PDT 2021


MarcusJohnson91 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();
----------------
aaron.ballman wrote:
> 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
The ConvertUTF version you linked contains `convertUTF32toUTF8String` but the one in LLVM does not, what's the process for updating this?


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