[llvm-bugs] [Bug 36754] New: Ignoring break after return type after compiler attributes

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Mar 15 08:38:03 PDT 2018


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

            Bug ID: 36754
           Summary: Ignoring break after return type after compiler
                    attributes
           Product: clang
           Version: 6.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: artemiev.mikhail at gmail.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

Seems like a regression in the 6.0.0 version:

$ cat test.cpp
int
a() {
   return 0;
}

[[gnu::optimize( "Os" )]] int
b() {
   return 0;
}

int
c() {
   return 0;
}

int
d() {
   return 0;
}

This is clang-format version 6.0.0 (tags/RELEASE_600/final)
$ clang-format --style="{BasedOnStyle: llvm, AlwaysBreakAfterReturnType: All}"
test.cpp
int
a() {
  return 0;
}

[[gnu::optimize("Os")]] int
b() { return 0; }

int c() {                     // HERE: break after return type is ignored
  return 0;
}

int
d() {
  return 0;
}

This is clang-format version 5.0.0 (trunk)
$ clang-format --style="{BasedOnStyle: llvm, AlwaysBreakAfterReturnType: All}"
~/main2.cpp
int
a() {
  return 0;
}

[[gnu::optimize("Os")]] int
b() {
  return 0;
}

int
c() {
  return 0;
}

int
d() {
  return 0;
}

All looks good in version 5.0.0.

-- 
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/20180315/d0e4c858/attachment-0001.html>


More information about the llvm-bugs mailing list