2020-03-08 Patrick Palka <ppalka@redhat.com>
+ PR c++/93729
+ * call.c (convert_like_real): Check complain before emitting an error
+ about binding a bit-field to a reference.
+
* cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier)
[TYPENAME_TYPE]: Print the TYPENAME_TYPE_FULLNAME instead of the
TYPE_NAME.
{
/* If the reference is volatile or non-const, we
cannot create a temporary. */
- if (lvalue & clk_bitfield)
- error_at (loc, "cannot bind bit-field %qE to %qT",
- expr, ref_type);
- else if (lvalue & clk_packed)
- error_at (loc, "cannot bind packed field %qE to %qT",
- expr, ref_type);
- else
- error_at (loc, "cannot bind rvalue %qE to %qT",
- expr, ref_type);
+ if (complain & tf_error)
+ {
+ if (lvalue & clk_bitfield)
+ error_at (loc, "cannot bind bit-field %qE to %qT",
+ expr, ref_type);
+ else if (lvalue & clk_packed)
+ error_at (loc, "cannot bind packed field %qE to %qT",
+ expr, ref_type);
+ else
+ error_at (loc, "cannot bind rvalue %qE to %qT",
+ expr, ref_type);
+ }
return error_mark_node;
}
/* If the source is a packed field, and we must use a copy
2020-03-08 Patrick Palka <ppalka@redhat.com>
+ PR c++/93729
+ * g++.dg/concepts/pr93729.C: New test.
+
* g++.dg/concepts/diagnostic4.C: New test.
2020-03-08 H.J. Lu <hongjiu.lu@intel.com>