[LLVMbugs] [Bug 17833] New: C++11 Narrowing conversion from int to double should give warning, not error

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Nov 6 08:17:33 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=17833

            Bug ID: 17833
           Summary: C++11 Narrowing conversion from int to double should
                    give warning, not error
           Product: clang
           Version: 3.3
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: agner at agner.org
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Implicit conversion from int to double generates error under C++11:
error: non-constant-expression cannot be narrowed from type 'int' to 'double'.

In my opinion, this should be a warning, not an error, because it breaks
correct legacy code. The conversion from int to double is not in fact
narrowing, because there is no 32-bit integer value that cannot be represented
as a double.

Please see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49793

-- 
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/20131106/cff7e6d9/attachment.html>


More information about the llvm-bugs mailing list