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

            Bug ID: 22566
           Summary: Expected narrowing conversion during list
                    initialization of bool from double
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

Given the following code form this stackoverflow question
http://stackoverflow.com/q/27507361/1708801 :

#include <iostream>

struct X
{
    X(bool arg) { std::cout << arg << '\n'; }
};

int main() 
{
    double d = 7.0;
    X x{d};
}

I expect a narrowing conversion error on this line:

  X x{d};

Neither clang nor gcc produce an error although Visual Studio does. Although
the comment is now deleted Jonathan Wakely noted that the EDG compiler gives a
narrowing error for the code.

Submitted a gcc bug report as well:

  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65043

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to