| 1 |
// PR c++/29295 |
| 2 |
// { dg-do run { target c++14_down } } |
| 3 |
// { dg-do compile { target c++17 } } |
| 4 |
// make sure that a typedef for a bool will have the |
| 5 |
// the same results as a bool itself. |
| 6 |
|
| 7 |
extern "C" void abort(); |
| 8 |
typedef volatile bool my_bool; |
| 9 |
int main() |
| 10 |
{ |
| 11 |
my_bool b = false; |
| 12 |
int i; |
| 13 |
|
| 14 |
b++; // { dg-warning "3:use of an operand of type .bool. in .operator\\+\\+. is deprecated" "" { target { ! c++17 } } } |
| 15 |
// { dg-error "3:use of an operand of type .bool. in .operator\\+\\+. is forbidden" "" { target c++17 } .-1 } |
| 16 |
// { dg-warning ".volatile.-qualified type is deprecated" "" { target c++2a } .-2 } |
| 17 |
b++; // { dg-warning "3:use of an operand of type .bool. in .operator\\+\\+. is deprecated" "" { target { ! c++17 } } } |
| 18 |
// { dg-error "3:use of an operand of type .bool. in .operator\\+\\+. is forbidden" "" { target c++17 } .-1 } |
| 19 |
// { dg-warning ".volatile.-qualified type is deprecated" "" { target c++2a } .-2 } |
| 20 |
i = b; |
| 21 |
if (i != 1) |
| 22 |
abort (); |
| 23 |
return 0; |
| 24 |
} |
| 25 |
|
| 26 |
|