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: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
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.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs