PR c++/85765 - SFINAE and non-type default template arg.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / Wnarrowing1.C
blob4df30255474c465a889025e9643860b8a4570140
1 // PR c++/53159
2 // { dg-do compile { target c++11 } }
3 // { dg-options "-Wnarrowing -Wno-overflow" }
5 struct X
7   constexpr operator int() { return __INT_MAX__; }
8 };
10 int f() { return __INT_MAX__; }
12 signed char a { __INT_MAX__ };     // { dg-error "narrowing conversion" }
13 signed char b { f() };             // { dg-warning "narrowing conversion" }
14 signed char c { X{} };             // { dg-error "narrowing conversion" }
16 signed char ar[] { __INT_MAX__ };  // { dg-error "narrowing conversion" }
17 signed char br[] { f() };          // { dg-warning "narrowing conversion" }
18 signed char cr[] { X{} };          // { dg-error "narrowing conversion" }