+2016-08-06 Jonathan Wakely <jwakely@redhat.com>
+
+ * call.c (convert_like_real): Harmonize diagnostics for invalid
+ reference binding.
+
2016-08-05 Martin Sebor <msebor@redhat.com>
* constexpr.c (cxx_eval_store_expression): Remove hyphen from
tree extype = TREE_TYPE (expr);
if (TYPE_REF_IS_RVALUE (ref_type)
&& lvalue_p (expr))
- error_at (loc, "cannot bind %qT lvalue to %qT",
- extype, totype);
+ error_at (loc, "cannot bind rvalue reference of type %qT to "
+ "lvalue of type %qT", totype, extype);
else if (!TYPE_REF_IS_RVALUE (ref_type) && !lvalue_p (expr)
&& !CP_TYPE_CONST_NON_VOLATILE_P (TREE_TYPE (ref_type)))
- error_at (loc, "invalid initialization of non-const reference of "
- "type %qT from an rvalue of type %qT", totype, extype);
+ error_at (loc, "cannot bind non-const lvalue reference of "
+ "type %qT to an rvalue of type %qT", totype, extype);
else if (!reference_compatible_p (TREE_TYPE (totype), extype))
- error_at (loc, "binding %qT to reference of type %qT "
- "discards qualifiers", extype, totype);
+ error_at (loc, "binding reference of type %qT to %qT "
+ "discards qualifiers", totype, extype);
else
gcc_unreachable ();
maybe_print_user_conv_context (convs);
+2016-08-06 Jonathan Wakely <jwakely@redhat.com>
+
+ * g++.dg/conversion/pr16333.C: Adjust dg-error regexp.
+ * g++.dg/conversion/pr41426.C: Likewise.
+ * g++.dg/conversion/pr66211.C: Likewise.
+ * g++.dg/cpp1y/lambda-init9.C: Likewise.
+ * g++.dg/init/ref8.C: Likewise.
+ * g++.old-deja/g++.law/cvt20.C: Likewise.
+ * g++.old-deja/g++.mike/p9732c.C: Likewise.
+
2016-08-05 Patrick Palka <ppalka@gcc.gnu.org>
PR tree-optimization/18046