Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gcc.dg/Wenum-conversion.c @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | 1830386684a0 |
children |
line wrap: on
line source
/* { dg-do compile } */ /* { dg-options "-Wenum-conversion" } */ enum X { x1, x2 }; enum Y { y1, y2 }; enum X obj = y1; /* { dg-warning "implicit conversion from .enum Y. to .enum X." } */ enum Y obj2 = y1; enum X obj3; void foo() { obj3 = y2; /* { dg-warning "implicit conversion from .enum Y. to .enum X." } */ } void bar(enum X); void f(void) { bar (y1); /* { dg-warning "implicit conversion from .enum Y. to .enum X." } */ }