[llvm-bugs] [Bug 27061] New: -Wfloat-conversion doesn't catch "int += double"
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Mar 24 14:30:13 PDT 2016
https://llvm.org/bugs/show_bug.cgi?id=27061
Bug ID: 27061
Summary: -Wfloat-conversion doesn't catch "int += double"
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Frontend
Assignee: unassignedclangbugs at nondot.org
Reporter: etlverified at gmail.com
CC: llvm-bugs at lists.llvm.org
Classification: Unclassified
The following code compiles cleanly with clang with '-Weverything':
--------------------
int main()
{
int x = 3;
x += 1.234;
return x;
}
--------------------
It is expected to issue a -Wfloat-conversion warning. For example, gcc 4.9
gives:
--------------------
tmp.cc: In function 'int main()':
tmp.cc:4:7: warning: conversion to 'int' from 'double' may alter its value
[-Wfloat-conversion]
x += 1.234;
--------------------
--
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/20160324/b064d872/attachment.html>
More information about the llvm-bugs
mailing list