/* Report error messages, build initializers, and perform
some front-end optimizations for C++ compiler.
- Copyright (C) 1987-2023 Free Software Foundation, Inc.
+ Copyright (C) 1987-2024 Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
This file is part of GCC.
else if (complain & tf_error)
{
int savederrorcount = errorcount;
- permerror (loc, OPT_Wnarrowing,
- "narrowing conversion of %qE from %qH to %qI",
- init, ftype, type);
+ permerror_opt (loc, OPT_Wnarrowing,
+ "narrowing conversion of %qE from %qH to %qI",
+ init, ftype, type);
if (errorcount == savederrorcount)
ok = true;
}
TREE_TYPE (expr) = ttype;
return expr;
}
- expr = build_non_dependent_expr (expr);
}
if (MAYBE_CLASS_TYPE_P (type))
/* Build an expression for "object + offset" where offset is the
value stored in the pointer-to-data-member. */
ptype = build_pointer_type (type);
- datum = fold_build_pointer_plus (fold_convert (ptype, datum), component);
+ datum = cp_convert (ptype, datum, complain);
+ if (!processing_template_decl)
+ datum = build2 (POINTER_PLUS_EXPR, ptype,
+ datum, convert_to_ptrofftype (component));
+ datum = cp_fully_fold (datum);
datum = cp_build_fold_indirect_ref (datum);
if (datum == error_mark_node)
return error_mark_node;