This patch adds the ability to see in shorten_compare that a constant
comes from an enumeral type. It does so by using in both C/C++ the
existing infrastructure from the C FE (c_expr). Currently, only the C
FE carries down the correct information to avoid warning, so C++ still
warns. However, this patch also opens the possibility to pass down
this info in the C++ FE using c_expr, and avoid warning in a follow up
patch.

Bootstrapped and regression tested. This is a proof-of-concept, so I
don't provide a changelog or update the comments of new/existing
functions.

Comments? Is this approach OK?

Cheers,

Manuel.

Attachment: fix-pr51712-2.diff
Description: Binary data

Reply via email to