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

            Bug ID: 47901
           Summary: clang-format puts attribute bracket on a new line
           Product: clang
           Version: 10.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

For the following code:

struct foo {
  [[deprecated("Construct from bla-bla-bla-bla-bla-bla-bla-bla instead.
Deprecated because of bla-bla-bla-bla-bla")]] static void ParseFromFile(const
char* path);
};

The command `clang-format-10 -style=Google -i bad_clang_format.hpp` produces
the following formatting:

struct foo {
  [
      [deprecated("Construct from bla-bla-bla-bla-bla-bla-bla-bla instead. "
                  "Deprecated because of bla-bla-bla-bla-bla")]] static void
  ParseFromFile(const char* path);
};


That formatting seems wrong. Removing `-style=Google` for that particular case
fixes the formatting:

struct foo {
  [[deprecated("Construct from bla-bla-bla-bla-bla-bla-bla-bla instead. "
               "Deprecated because of bla-bla-bla-bla-bla")]] static void
  ParseFromFile(const char *path);
};


Please fix the behaviour of `-style=Google` for cases like above.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to