From 22d60ad267dae84a52bd57521bcb8a99bf33eb41 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Mon, 6 Jun 2011 00:16:38 -0400 Subject: [PATCH] re PR c++/49134 (ICE in g++.dg/cpp0x/constexpr tests for arm) PR c++/49134 * tree.c (build_target_expr): Deal with ARM ABI tweaks. From-SVN: r174682 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/tree.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 48f39f4da21..668dd5e19d4 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2011-06-06 Jason Merrill + + PR c++/49134 + * tree.c (build_target_expr): Deal with ARM ABI tweaks. + 2011-06-04 Jonathan Wakely * init.c (build_delete): Warn when deleting type with non-virtual diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 11e195ea581..025fe2d1d1f 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -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 -- 2.30.2