[llvm-bugs] [Bug 29134] New: clang-cl doesn't consider __assume() when emitting [-Wreturn-type] warnings
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Aug 25 04:54:59 PDT 2016
https://llvm.org/bugs/show_bug.cgi?id=29134
Bug ID: 29134
Summary: clang-cl doesn't consider __assume() when emitting
[-Wreturn-type] warnings
Product: clang
Version: 3.9
Hardware: PC
OS: Windows NT
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: 6yearold at gmail.com
CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
Classification: Unclassified
The code
int func2(int i) {
switch(i) {
case 1:
return 1;
case 2:
return 2;
default:
__assume(0);
}
}
int main(int p)
{
func2(2);
}
produces this warning:
tst.cpp(11,1): warning: control may reach end of non-void function
[-Wreturn-type]
}
^
while cl.exe is silent on that.
This is a problem when compiling with -Werror, because this warning gets turned
into a error and this leads to compilation failure.
--
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/20160825/cd746f95/attachment.html>
More information about the llvm-bugs
mailing list