Testcase warning fix for gcc-9

warning: returning reference to temporary [-Wreturn-local-addr]
This commit is contained in:
William S Fulton 2019-07-09 08:12:05 +01:00
commit 35e24ebd66

View file

@ -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;