From 06a85dd37ff6f5fb6c418cb218f707e428cf20c4 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Sat, 19 Feb 2011 17:39:50 -0500 Subject: re PR c++/47503 ([C++0x] ICE: in adjust_temp_type, at cp/semantics.c:5876 with -fno-elide-constructors) PR c++/47503 * semantics.c (cxx_eval_call_expression): Shortcut trivial copy. From-SVN: r170330 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/semantics.c | 4 ++++ 2 files changed, 9 insertions(+) (limited to 'gcc/cp') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0f6ece2..938d3f2 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2011-02-19 Jason Merrill + + PR c++/47503 + * semantics.c (cxx_eval_call_expression): Shortcut trivial copy. + 2011-02-18 Paolo Carlini PR c++/47795 diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index e102ba3..8944690 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -6019,6 +6019,10 @@ cxx_eval_call_expression (const constexpr_call *old_call, tree t, return t; } + /* Shortcut trivial copy constructor/op=. */ + if (call_expr_nargs (t) == 2 && trivial_fn_p (fun)) + return convert_from_reference (get_nth_callarg (t, 1)); + /* If in direct recursive call, optimize definition search. */ if (old_call != NULL && old_call->fundef->decl == fun) new_call.fundef = old_call->fundef; -- cgit v1.1