comparison gcc/testsuite/g++.dg/cpp0x/constexpr-shift1.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
9 constexpr int i1 = fn1 (1, -1); // { dg-message "in .constexpr. expansion of " } 9 constexpr int i1 = fn1 (1, -1); // { dg-message "in .constexpr. expansion of " }
10 10
11 constexpr int 11 constexpr int
12 fn2 (int i, int j) 12 fn2 (int i, int j)
13 { 13 {
14 return i << j; // { dg-error "is >= than the precision of the left operand" } 14 return i << j; // { dg-error "is greater than or equal to the precision .. of the left operand" }
15 } 15 }
16 16
17 constexpr int i2 = fn2 (1, 200); // { dg-message "in .constexpr. expansion of " } 17 constexpr int i2 = fn2 (1, 200); // { dg-message "in .constexpr. expansion of " }
18 18
19 constexpr int 19 constexpr int
20 fn3 (int i, int j) 20 fn3 (int i, int j)
21 { 21 {
22 return i << j; // { dg-error "is negative" } 22 return i << j; // { dg-error "is negative" "" { target c++17_down } }
23 } 23 }
24 24
25 constexpr int i3 = fn3 (-1, 2); // { dg-message "in .constexpr. expansion of " } 25 constexpr int i3 = fn3 (-1, 2); // { dg-message "in .constexpr. expansion of " "" { target c++17_down } }
26 26
27 constexpr int 27 constexpr int
28 fn4 (int i, int j) 28 fn4 (int i, int j)
29 { 29 {
30 return i << j; // { dg-error "overflows" } 30 return i << j; // { dg-error "overflows" "" { target c++17_down } }
31 } 31 }
32 32
33 constexpr int i4 = fn4 (__INT_MAX__, 2); // { dg-message "in .constexpr. expansion of " } 33 constexpr int i4 = fn4 (__INT_MAX__, 2); // { dg-message "in .constexpr. expansion of " "" { target c++17_down } }
34 34
35 constexpr int 35 constexpr int
36 fn5 (int i, int j) 36 fn5 (int i, int j)
37 { 37 {
38 return i << j; 38 return i << j;
41 constexpr int i5 = fn5 (__INT_MAX__, 1); 41 constexpr int i5 = fn5 (__INT_MAX__, 1);
42 42
43 constexpr int 43 constexpr int
44 fn6 (unsigned int i, unsigned int j) 44 fn6 (unsigned int i, unsigned int j)
45 { 45 {
46 return i << j; // { dg-error "is >= than the precision of the left operand" } 46 return i << j; // { dg-error "is greater than or equal to the precision .. of the left operand" }
47 } 47 }
48 48
49 constexpr int i6 = fn6 (1, -1); // { dg-message "in .constexpr. expansion of " } 49 constexpr int i6 = fn6 (1, -1); // { dg-message "in .constexpr. expansion of " }
50 50
51 constexpr int 51 constexpr int
65 constexpr int i8 = fn8 (-1, 1); 65 constexpr int i8 = fn8 (-1, 1);
66 66
67 constexpr int 67 constexpr int
68 fn9 (int i, int j) 68 fn9 (int i, int j)
69 { 69 {
70 return i >> j; // { dg-error "is >= than the precision of the left operand" } 70 return i >> j; // { dg-error "is greater than or equal to the precision .. of the left operand" }
71 } 71 }
72 72
73 constexpr int i9 = fn9 (1, 200); // { dg-message "in .constexpr. expansion of " } 73 constexpr int i9 = fn9 (1, 200); // { dg-message "in .constexpr. expansion of " }