The test case assumes that sizeof(tree_code) >= 2. On some targets, like
Cortex-M on arm-none-eabi, -fshort-enums is enabled by default and in
that case, sizeof(tree_code) will be 1 and the following warning is
emitted:
.../pr97315-1.C:8:13: warning: width of 'tree_base::code' exceeds its type
Avoid the warning by forcing -fno-short-enums.
gcc/testsuite/ChangeLog:
* g++.dg/opt/pr97315-1.C: Add -fno-short-enums.
Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
/* { dg-do compile } */
-/* { dg-options "-O3 -fno-exceptions" } */
+/* { dg-options "-O3 -fno-exceptions -fno-short-enums" } */
typedef struct tree_node *tree;
enum tree_code { RECORD_TYPE, QUAL_UNION_TYPE };