[Bug c++/58051] [DR1579] No named return value optimization when returned object is implicitly converted
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jun 26 10:06:00 GMT 2014
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58051
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I wonder if it's this simple:
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -8618,8 +8618,6 @@ check_return_expr (tree retval, bool *no_warning)
|| TREE_CODE (retval) == PARM_DECL)
&& DECL_CONTEXT (retval) == current_function_decl
&& !TREE_STATIC (retval)
- && same_type_p ((TYPE_MAIN_VARIANT (TREE_TYPE (retval))),
- (TYPE_MAIN_VARIANT (functype)))
/* This is only interesting for class type. */
&& CLASS_TYPE_P (functype))
flags = flags | LOOKUP_PREFER_RVALUE;
More information about the Gcc-bugs
mailing list