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: kreme...@apple.com
          Reporter: abramo.bagn...@bugseng.com
                CC: llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to