https://bugs.llvm.org/show_bug.cgi?id=52103
Bug ID: 52103
Summary: Wunreachable-code warns that [[likely]] and
[[unlikely]] are unreachable
Product: clang
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++2a
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected]
$ cat foo.cc
int main(int argc, char* argv[]) {
if (argc > 100) [[unlikely]]
return 1;
return 0;
}
$ out/gn/bin/clang -Wunreachable-code -c foo.cc -std=c++20
foo.cc:2:19: warning: code will never be executed [-Wunreachable-code]
if (argc > 100) [[unlikely]]
^~~~~~~~~~~~
That's pretty silly.
(There's also bug 19020; not quite sure if this is a dupe of that or not.)
--
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