https://llvm.org/bugs/show_bug.cgi?id=25964

            Bug ID: 25964
           Summary: -Wliteral-conversion diagnostic with negative values
                    could be improved
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangb...@nondot.org
          Reporter: aa...@aaronballman.com
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

Consider the following code:

void f() {
  bool b1 = -0.99f;
}

This produces the diagnostic: implicit conversion from 'float' to 'bool'
changes value from 0.99 to true

While it's valid to drop the negative sign in the diagnostic (because that's
not part of the literal value, but is instead an expression), it can still be a
bit confusing to users. It might fit programmer's mental models more closely
for the diagnostic to print -0.99 instead.

-- 
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

Reply via email to