[Bug other/97076] New: clang-format file does not work for some C++11 code

dmjpp at hotmail dot com gcc-bugzilla@gcc.gnu.org
Wed Sep 16 18:18:11 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97076

            Bug ID: 97076
           Summary: clang-format file does not work for some C++11 code
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dmjpp at hotmail dot com
  Target Milestone: ---

This is not a bug in GCC, but in the supporting files in contrib. The
clang-format file at the end has Standard: Cpp03. See
https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=contrib/clang-format;h=7a4e96f64ca64a332ca5f945f08425c3a3e045c6;hb=HEAD#l150

I was writing a libstdc++ patch where I used the C++11 feature Unicode string
literals.

auto x = u"abc";

The clang format adds a space between the u and the quotation marks, making the
file invalid C++.

auto x = u "abc";

The fix is to change the standard to auto:

Standard: Auto


More information about the Gcc-bugs mailing list