https://bugs.llvm.org/show_bug.cgi?id=50415
Bug ID: 50415
Summary: -Wreturn-type has many false positives
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangb...@nondot.org
Reporter: gonzalo.gades...@gmail.com
CC: blitzrak...@gmail.com, dgre...@apple.com,
erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
richard-l...@metafoo.co.uk
Example (https://clang.godbolt.org/z/66YqsGEha):
int f(unsigned i) {
if (i < unsigned(-1)) return i;
}
int g(unsigned i) {
if (i >= 0) return i;
}
compiled with clang++ -std=c++17 (no -Wall, no -Wextra) warns with
warning: non-void function does not return a value in all control paths
[-Wreturn-type]
for both functions.
AFAICT these warnings are false positives.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs