gcc/testsuite/g++.dg/parse/attr3.C
raw| 1 | // PR c++/39219 |
| 2 | |
| 3 | enum __attribute__ ((deprecated)) E { e }; |
| 4 | struct S { enum __attribute__ ((deprecated)) F { f = e }; }; |
| 5 | |
| 6 | int main () { |
| 7 | E x; // { dg-warning "'E' is deprecated" } |
| 8 | x = e; |
| 9 | |
| 10 | S::F y; // { dg-warning "'F' is deprecated" } |
| 11 | y = S::f; |
| 12 | |
| 13 | return x + y; // { dg-warning "arithmetic between different enumeration types" "" { target { c++20 && c++23_down } } } |
| 14 | // { dg-error "arithmetic between different enumeration types" "" { target c++26 } .-1 } |
| 15 | } |