===================================================================
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c++11" } */
+
+extern "C" void do_not_remove ();
+
+struct A
+{
+ A () { }
+ A (A const&) { do_not_remove (); }
+};
+
+A
+f ()
+{
+ alignas (2 * alignof (A)) A x;
+ return x;
+}
+
+/* { dg-final { scan-assembler "do_not_remove" } } */
Property changes on: testsuite/g++.dg/pr57175.C
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision URL
===================================================================
@@ -8362,21 +8362,21 @@ check_return_expr (tree retval, bool *no
See finish_function and finalize_nrv for the rest of this optimization. */
named_return_value_okay_p =
(retval != NULL_TREE
/* Must be a local, automatic variable. */
&& VAR_P (retval)
&& DECL_CONTEXT (retval) == current_function_decl
&& ! TREE_STATIC (retval)
&& ! DECL_ANON_UNION_VAR_P (retval)
- && (DECL_ALIGN (retval) >= DECL_ALIGN (result))
+ && (DECL_ALIGN (retval) <= DECL_ALIGN (result))
/* The cv-unqualified type of the returned value must be the
same as the cv-unqualified return type of the
function. */
&& same_type_p ((TYPE_MAIN_VARIANT (TREE_TYPE (retval))),
(TYPE_MAIN_VARIANT (functype)))
/* And the returned value must be non-volatile. */
&& ! TYPE_VOLATILE (TREE_TYPE (retval)));
if (fn_returns_value_p && flag_elide_constructors)
{