c++: Implement P1957R2, T* to bool should be considered narrowing.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / initlist92.C
blob213b192d44111addc3fb4d3862b824b01c9f9a53
1 // PR c++/64665, DR 1467 
2 // { dg-do compile { target c++11 } }
4 #include <string>
6 bool Test1(bool);
7 bool Test1(std::string) = delete;
9 bool Test2(int) = delete;
10 bool Test2(std::initializer_list<int>);
12 struct S 
13
14     S(int _a) : a(_a) {}
15 private:
16     int a;
18 bool Test3(int);
19 bool Test3(S) = delete;
21 bool Test4(bool) = delete;
22 bool Test4(std::initializer_list<std::string>);
24 int main () 
26   ( Test1({"false"}) ); // { dg-error "narrowing" }
27   ( Test2({123}) );
28   ( Test3({456}) );
29   ( Test4({"false"}) );