+2006-04-19 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/10385
+ * rtti.c (build_dynamic_cast_1): Check for invalid conversions
+ before calling convert_to_reference.
+ * cvt.c (convert_to_reference): Assert that reftype is a
+ REFERENCE_TYPE.
+
2006-04-19 Mark Mitchell <mark@codesourcery.com>
PR c++/27102
intype = TREE_TYPE (expr);
gcc_assert (TREE_CODE (intype) != REFERENCE_TYPE);
+ gcc_assert (TREE_CODE (reftype) == REFERENCE_TYPE);
intype = TYPE_MAIN_VARIANT (intype);
}
else
{
- /* Apply trivial conversion T -> T& for dereferenced ptrs. */
exprtype = build_reference_type (exprtype);
- expr = convert_to_reference (exprtype, expr, CONV_IMPLICIT,
- LOOKUP_NORMAL, NULL_TREE);
/* T is a reference type, v shall be an lvalue of a complete class
type, and the result is an lvalue of the type referred to by T. */
goto fail;
}
+ /* Apply trivial conversion T -> T& for dereferenced ptrs. */
+ expr = convert_to_reference (exprtype, expr, CONV_IMPLICIT,
+ LOOKUP_NORMAL, NULL_TREE);
}
/* The dynamic_cast operator shall not cast away constness. */
+2006-04-19 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/10385
+ * g++.dg/conversion/dynamic1.C: New test.
+
2006-04-19 Mark Mitchell <mark@codesourcery.com>
PR c++/27102