[PATCH] D115938: [clang-format] Formatter does not handle c++11 string literal prefix with stringize #

Marek Kurdej via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 17 07:00:25 PST 2021


curdeius added a comment.

You shouldn't have added the outer quotes as `#str` adds them.
This works:

  // clang-format off
  #define MyRawString(str) R#str
  
  void foo()
  {
      const auto * s1 = MyRawString((" Hello \ world "));
      const auto * s2 = MyRawString(abc(" Hello \ world ")abc);
  }


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115938



More information about the cfe-commits mailing list