commit 36e8e35be7b42ec47b46364a385accfc8af9e93b
Author: Jason Merrill <jason@redhat.com>
Date: Thu Jun 2 14:35:53 2011 -0400
PR c++/49134
* tree.c (build_target_expr): Deal with ARM ABI tweaks.
@@ -292,6 +292,9 @@ build_target_expr (tree decl, tree value, tsubst_flags_t complain)
#ifdef ENABLE_CHECKING
gcc_assert (VOID_TYPE_P (TREE_TYPE (value))
|| TREE_TYPE (decl) == TREE_TYPE (value)
+ /* On ARM ctors return 'this'. */
+ || (TREE_CODE (TREE_TYPE (value)) == POINTER_TYPE
+ && TREE_CODE (value) == CALL_EXPR)
|| useless_type_conversion_p (TREE_TYPE (decl),
TREE_TYPE (value)));
#endif