annotate gcc/testsuite/g++.dg/expr/bool1.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // PR c++/29295
kono
parents:
diff changeset
2 // { dg-do run { target c++14_down } }
kono
parents:
diff changeset
3 // { dg-do compile { target c++17 } }
kono
parents:
diff changeset
4 // make sure that a typedef for a bool will have the
kono
parents:
diff changeset
5 // the same results as a bool itself.
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 extern "C" void abort();
kono
parents:
diff changeset
8 typedef bool my_bool;
kono
parents:
diff changeset
9 int main()
kono
parents:
diff changeset
10 {
kono
parents:
diff changeset
11 my_bool b = false;
kono
parents:
diff changeset
12 int i;
kono
parents:
diff changeset
13
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
14 b++; // { dg-warning "3:use of an operand of type .bool. in .operator\\+\\+. is deprecated" "" { target { ! c++17 } } }
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
15 // { dg-error "3:use of an operand of type .bool. in .operator\\+\\+. is forbidden" "" { target c++17 } .-1 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
16 b++; // { dg-warning "3:use of an operand of type .bool. in .operator\\+\\+. is deprecated" "" { target { ! c++17 } } }
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
17 // { dg-error "3:use of an operand of type .bool. in .operator\\+\\+. is forbidden" "" { target c++17 } .-1 }
111
kono
parents:
diff changeset
18 i = b;
kono
parents:
diff changeset
19 if (i != 1)
kono
parents:
diff changeset
20 abort ();
kono
parents:
diff changeset
21 return 0;
kono
parents:
diff changeset
22 }
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24