[Bug c++/65043] New: Expected narrowing conversion during list initialization of bool from double
yaghmour.shafik at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Feb 12 16:34:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65043
Bug ID: 65043
Summary: Expected narrowing conversion during list
initialization of bool from double
Product: gcc
Version: 5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: yaghmour.shafik at gmail dot com
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.
More information about the Gcc-bugs
mailing list