From 35e24ebd668d2c2596c83183fa718709a5d175bf Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Tue, 9 Jul 2019 08:12:05 +0100 Subject: [PATCH] Testcase warning fix for gcc-9 warning: returning reference to temporary [-Wreturn-local-addr] --- Examples/test-suite/cpp11_rvalue_reference2.i | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Examples/test-suite/cpp11_rvalue_reference2.i b/Examples/test-suite/cpp11_rvalue_reference2.i index 9aaf4accb..a2a0020f5 100644 --- a/Examples/test-suite/cpp11_rvalue_reference2.i +++ b/Examples/test-suite/cpp11_rvalue_reference2.i @@ -31,7 +31,7 @@ struct Thingy { // test both primitive and user defined rvalue reference default arguments and compactdefaultargs void compactDefaultArgs(const bool &&b = (const bool &&)PublicGlobalTrue, const UserDef &&u = (const UserDef &&)PublicUserDef) {} void privateDefaultArgs(const bool &&b = (const bool &&)PrivateTrue) {} - operator int &&() { return std::move(0); } + operator int &&() { return std::move(val); } Thingy(const Thingy& rhs) : val(rhs.val), lvalref(rhs.lvalref), rvalref(std::move(rhs.rvalref)) {} Thingy& operator=(const Thingy& rhs) { val = rhs.val;