1 // PR c++/68978
2 
3 typedef int int32_t __attribute__((mode (__SI__)));
4 
5 int32_t i = 0, c = 0, radix = 10, max = 0x7fffffff;
6 
toi_1()7 template <typename T> int32_t toi_1() {
8   if (max < ((i *= radix) += c))
9     return 0;
10   return i;
11 }
12 
toi_2()13 template <typename T> int32_t toi_2() {
14   if (max < ((i = radix) = c))
15     return 0;
16   return i;
17 }
18 
toi_3()19 template <typename T> int32_t toi_3() {
20   if (max < ((i = radix) += c))
21     return 0;
22   return i;
23 }
24 
toi_4()25 template <typename T> int32_t toi_4() {
26   if (max < ((i += radix) = c))
27     return 0;
28   return i;
29 }
30 
toi_5()31 template <typename T> int32_t toi_5() {
32   if (max < (((i = radix) += (c += 5)) *= 30))
33     return 0;
34   return i;
35 }
36 
37 int32_t x = toi_1<int32_t> ();
38 int32_t y = toi_2<int32_t> ();
39 int32_t z = toi_3<int32_t> ();
40 int32_t w = toi_4<int32_t> ();
41 int32_t r = toi_5<int32_t> ();
42