[llvm-bugs] [Bug 30651] New: Sever bug in clang-tidy for readability-else-after-return

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Oct 10 03:15:36 PDT 2016


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

            Bug ID: 30651
           Summary: Sever bug in clang-tidy for
                    readability-else-after-return
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: abramo.bagnara at bugseng.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

$ cat p.c
int f(int x) {
  if (x == 0) {
    ++x;
  }
  else if (x <= 1) {
    return 2;
  }
  else {
    return 3;
  }
  return 0;
}
$ clang-tidy-4.0 -checks=readability-else-after-return p.c --
1 warning generated.
/tmp/p.c:8:3: warning: do not use 'else' after 'return'
[readability-else-after-return]
  else {
  ^

The proposed change would alter the semantic of program.

-- 
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/20161010/815b9f8a/attachment.html>


More information about the llvm-bugs mailing list