Fix c++ compiler warnings in c++11 testcases

This commit is contained in:
William S Fulton 2017-06-03 17:15:44 +01:00
commit be63f73e33
6 changed files with 31 additions and 10 deletions

View file

@ -23,7 +23,7 @@ struct Thingy {
int val;
int &lvalref;
int &&rvalref;
Thingy(int v) : val(v), lvalref(val), rvalref(22) {}
Thingy(int v, int &&rvalv) : val(v), lvalref(val), rvalref(std::move(rvalv)) {}
void refIn(long &i) {}
void rvalueIn(long &&i) {}
short && rvalueInOut(short &&i) { return std::move(i); }
@ -32,7 +32,7 @@ struct Thingy {
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); }
Thingy(const Thingy& rhs) : val(rhs.val), lvalref(rhs.lvalref), rvalref(copy_int(rhs.rvalref)) {}
Thingy(const Thingy& rhs) : val(rhs.val), lvalref(rhs.lvalref), rvalref(std::move(rhs.rvalref)) {}
Thingy& operator=(const Thingy& rhs) {
val = rhs.val;
lvalref = rhs.lvalref;
@ -41,17 +41,18 @@ struct Thingy {
}
private:
static const bool PrivateTrue;
int copy_int(int& i) { return i; }
Thingy();
};
const bool Thingy::PrivateTrue = true;
short && globalRvalueInOut(short &&i) { return std::move(i); }
Thingy &&globalrrval = Thingy(55);
int glob = 123;
Thingy &&globalrrval = Thingy(55, std::move(glob));
short && func(short &&i) { return std::move(i); }
Thingy getit() { return Thingy(22); }
Thingy getit() { return Thingy(22, std::move(glob)); }
void rvalrefFunction1(int &&v = (int &&)5) {}
void rvalrefFunctionBYVAL(short (Thingy::*memFunc)(short)) {}