https://bugs.llvm.org/show_bug.cgi?id=40375
Bug ID: 40375
Summary: AttributedStatement not correctly handled with
-Wunreachable-code
Product: clang
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: Frontend
Assignee: unassignedclangb...@nondot.org
Reporter: kpreis...@gmail.com
CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
richard-l...@metafoo.co.uk
The following code produces an unreachable code warning that is attached to the
attribute (which doesn't make sense):
int f1() {
[[gsl::suppress("foobar")]]
return 1;
return 2;
}
The warning is as follows (Compiler Explorer: https://godbolt.org/z/S7eOSM):
<source>:3:5: warning: code will never be executed [-Wunreachable-code]
[[gsl::suppress("foobar")]]
^~~~~~~~~~~~~~~~~~~~~~~~~~~
I would expect a warning to be attached to the "return 2;" statement.
I think there's a bug in the handling of AttributedStatements (which are not
used very often so far).
--
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