Turns on -Wshadow (by Preston Jackson).
This commit is contained in:
@@ -205,7 +205,7 @@ TEST(RangeTest, IntRangeWithCustomStepOverUpperBound) {
|
||||
// copy constructor, operator=(), operator+(), and operator<().
|
||||
class DogAdder {
|
||||
public:
|
||||
explicit DogAdder(const char* value) : value_(value) {}
|
||||
explicit DogAdder(const char* a_value) : value_(a_value) {}
|
||||
DogAdder(const DogAdder& other) : value_(other.value_.c_str()) {}
|
||||
|
||||
DogAdder operator=(const DogAdder& other) {
|
||||
@@ -243,7 +243,7 @@ TEST(RangeTest, WorksWithACustomType) {
|
||||
|
||||
class IntWrapper {
|
||||
public:
|
||||
explicit IntWrapper(int value) : value_(value) {}
|
||||
explicit IntWrapper(int a_value) : value_(a_value) {}
|
||||
IntWrapper(const IntWrapper& other) : value_(other.value_) {}
|
||||
|
||||
IntWrapper operator=(const IntWrapper& other) {
|
||||
|
||||
@@ -4009,7 +4009,7 @@ TEST(AssertionTest, NonFixtureSubroutine) {
|
||||
// An uncopyable class.
|
||||
class Uncopyable {
|
||||
public:
|
||||
explicit Uncopyable(int value) : value_(value) {}
|
||||
explicit Uncopyable(int a_value) : value_(a_value) {}
|
||||
|
||||
int value() const { return value_; }
|
||||
bool operator==(const Uncopyable& rhs) const {
|
||||
@@ -5095,7 +5095,7 @@ TEST(AssertionResultTest, StreamingWorks) {
|
||||
// both in the global namespace.
|
||||
class Base {
|
||||
public:
|
||||
explicit Base(int x) : x_(x) {}
|
||||
explicit Base(int an_x) : x_(an_x) {}
|
||||
int x() const { return x_; }
|
||||
private:
|
||||
int x_;
|
||||
@@ -5122,7 +5122,7 @@ TEST(MessageTest, CanStreamUserTypeInGlobalNameSpace) {
|
||||
namespace {
|
||||
class MyTypeInUnnamedNameSpace : public Base {
|
||||
public:
|
||||
explicit MyTypeInUnnamedNameSpace(int x): Base(x) {}
|
||||
explicit MyTypeInUnnamedNameSpace(int an_x): Base(an_x) {}
|
||||
};
|
||||
std::ostream& operator<<(std::ostream& os,
|
||||
const MyTypeInUnnamedNameSpace& val) {
|
||||
@@ -5147,7 +5147,7 @@ TEST(MessageTest, CanStreamUserTypeInUnnamedNameSpace) {
|
||||
namespace namespace1 {
|
||||
class MyTypeInNameSpace1 : public Base {
|
||||
public:
|
||||
explicit MyTypeInNameSpace1(int x): Base(x) {}
|
||||
explicit MyTypeInNameSpace1(int an_x): Base(an_x) {}
|
||||
};
|
||||
std::ostream& operator<<(std::ostream& os,
|
||||
const MyTypeInNameSpace1& val) {
|
||||
@@ -5172,7 +5172,7 @@ TEST(MessageTest, CanStreamUserTypeInUserNameSpace) {
|
||||
namespace namespace2 {
|
||||
class MyTypeInNameSpace2 : public ::Base {
|
||||
public:
|
||||
explicit MyTypeInNameSpace2(int x): Base(x) {}
|
||||
explicit MyTypeInNameSpace2(int an_x): Base(an_x) {}
|
||||
};
|
||||
} // namespace namespace2
|
||||
std::ostream& operator<<(std::ostream& os,
|
||||
|
||||
@@ -48,7 +48,7 @@ class PrivateCode {
|
||||
|
||||
int x() const { return x_; }
|
||||
private:
|
||||
void set_x(int x) { x_ = x; }
|
||||
void set_x(int an_x) { x_ = an_x; }
|
||||
int x_;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user