https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111895
Marek Polacek <mpolacek at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mpolacek at gcc dot gnu.org --- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> --- I think we need something like diff --git a/gcc/c-family/c-common.cc b/gcc/c-family/c-common.cc index 0efdc677217..138328fe4f7 100644 --- a/gcc/c-family/c-common.cc +++ b/gcc/c-family/c-common.cc @@ -3670,7 +3670,7 @@ c_common_truthvalue_conversion (location_t location, tree expr) CASE_CONVERT: { tree totype = TREE_TYPE (expr); - tree fromtype = TREE_TYPE (TREE_OPERAND (expr, 0)); + tree fromtype = unlowered_expr_type (TREE_OPERAND (expr, 0)); if (POINTER_TYPE_P (totype) && !c_inhibit_evaluation_warnings diff --git a/gcc/cp/cvt.cc b/gcc/cp/cvt.cc index 4dfb39fb60b..7889f33f9eb 100644 --- a/gcc/cp/cvt.cc +++ b/gcc/cp/cvt.cc @@ -802,7 +802,7 @@ ocp_convert (tree type, tree expr, int convtype, int flags, if (INTEGRAL_CODE_P (code)) { - tree intype = TREE_TYPE (e); + tree intype = unlowered_expr_type (e); tree converted; if (TREE_CODE (type) == ENUMERAL_TYPE) except that unlowered_expr_type isn't available in c-family/, so that would have to be addressed.