https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85027
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org, | |jason at gcc dot gnu.org --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- build_conditional_expr_1 is called with BASELINK as arg1, and because arg2 is not specified, wraps it into a SAVE_EXPR: arg2 = arg1 = cp_save_expr (arg1); Later on perform_implicit_conversion_flags fails the conversion and does: if (complain & tf_error) { /* If expr has unknown type, then it is an overloaded function. Call instantiate_type to get good error messages. */ if (TREE_TYPE (expr) == unknown_type_node) instantiate_type (type, expr, complain); but instantiate_type doesn't handle a BASELINK wrapped into a SAVE_EXPR, only a BASELINK by itself. So, shall build_conditional_expr_1 for BASELINK (or for TREE_TYPE (arg1) == unknown_type_node) not create the SAVE_EXPR, or cp_save_expr not create SAVE_EXPR for these? Is there any chance that the BASELINK would actually be successfully converted to something like a bool?