[llvm-bugs] [Bug 32928] clang-format produces ugly results after rearranging function arguments containing raw strings.

via llvm-bugs llvm-bugs at lists.llvm.org
Thu May 4 15:30:58 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=32928

Daniel Jasper <djasper at google.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |WONTFIX
             Status|NEW                         |RESOLVED

--- Comment #1 from Daniel Jasper <djasper at google.com> ---
There isn't a good solution, as clang-format must not change the content of the
raw string literal as that would change the program's behavior (potentially).
We also won't get into the business of analyzing the raw string for where there
might be something to align to in it.

The one thing that clang-format already does is that it will respect your
line-break choices around 'R"('. So, I suggest manually reformatting this to:

test_app_dir.WriteManifest(base::StringPrintf(
    R"({
      "name": "Hosted App vs TDI Test",
      "version": "1",
      "manifest_version": 2,
      "app": {
        "launch": {
          "web_url": "%s"
        },
        "urls": ["*://app.site.com/frame_tree"]
      }
    })",
    url.spec().c_str()));

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170504/489a7b6d/attachment.html>


More information about the llvm-bugs mailing list