comparison gcc/testsuite/g++.dg/cpp0x/constexpr-shift1.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
4 fn1 (int i, int j) 4 fn1 (int i, int j)
5 { 5 {
6 return i << j; // { dg-error "is negative" } 6 return i << j; // { dg-error "is negative" }
7 } 7 }
8 8
9 constexpr int i1 = fn1 (1, -1); 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 >= than the precision of the left operand" }
15 } 15 }
16 16
17 constexpr int i2 = fn2 (1, 200); 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" }
23 } 23 }
24 24
25 constexpr int i3 = fn3 (-1, 2); 25 constexpr int i3 = fn3 (-1, 2); // { dg-message "in .constexpr. expansion of " }
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" }
31 } 31 }
32 32
33 constexpr int i4 = fn4 (__INT_MAX__, 2); 33 constexpr int i4 = fn4 (__INT_MAX__, 2); // { dg-message "in .constexpr. expansion of " }
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;
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 >= than the precision of the left operand" }
47 } 47 }
48 48
49 constexpr int i6 = fn6 (1, -1); 49 constexpr int i6 = fn6 (1, -1); // { dg-message "in .constexpr. expansion of " }
50 50
51 constexpr int 51 constexpr int
52 fn7 (int i, int j) 52 fn7 (int i, int j)
53 { 53 {
54 return i >> j; // { dg-error "is negative" } 54 return i >> j; // { dg-error "is negative" }
55 } 55 }
56 56
57 constexpr int i7 = fn7 (1, -1); 57 constexpr int i7 = fn7 (1, -1); // { dg-message "in .constexpr. expansion of " }
58 58
59 constexpr int 59 constexpr int
60 fn8 (int i, int j) 60 fn8 (int i, int j)
61 { 61 {
62 return i >> j; 62 return i >> j;
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 >= than the precision of the left operand" }
71 } 71 }
72 72
73 constexpr int i9 = fn9 (1, 200); 73 constexpr int i9 = fn9 (1, 200); // { dg-message "in .constexpr. expansion of " }