summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEnji Cooper <yaneurabeya@gmail.com>2019-02-13 00:35:38 (GMT)
committerEnji Cooper <yaneurabeya@gmail.com>2019-02-13 00:40:01 (GMT)
commited2fe122f8dc9aca844d724986d1d5cf5b65ea4e (patch)
tree50db424c3107760b1b00bac76ecdfc5a633433c3
parentc4ccab33aaa0e86741db7c02a1d1040af76bd059 (diff)
downloadgoogletest-ed2fe122f8dc9aca844d724986d1d5cf5b65ea4e.zip
googletest-ed2fe122f8dc9aca844d724986d1d5cf5b65ea4e.tar.gz
googletest-ed2fe122f8dc9aca844d724986d1d5cf5b65ea4e.tar.bz2
Fix -Wunused-private-field issues with clangrefs/pull/2119/head
Provide dummy accessors for private values that are set in initializers, but not actually used. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
-rw-r--r--googlemock/test/gmock-matchers_test.cc2
-rw-r--r--googletest/test/googletest-param-test-test.cc2
2 files changed, 4 insertions, 0 deletions
diff --git a/googlemock/test/gmock-matchers_test.cc b/googlemock/test/gmock-matchers_test.cc
index c2f1d0a..cdca230 100644
--- a/googlemock/test/gmock-matchers_test.cc
+++ b/googlemock/test/gmock-matchers_test.cc
@@ -982,6 +982,8 @@ class Unprintable {
Unprintable() : c_('a') {}
bool operator==(const Unprintable& /* rhs */) const { return true; }
+ // -Wunused-private-field: dummy accessor for `c_`.
+ char dummy_c() { return c_; }
private:
char c_;
};
diff --git a/googletest/test/googletest-param-test-test.cc b/googletest/test/googletest-param-test-test.cc
index 2ab9b1b..6c187df 100644
--- a/googletest/test/googletest-param-test-test.cc
+++ b/googletest/test/googletest-param-test-test.cc
@@ -964,6 +964,8 @@ INSTANTIATE_TEST_SUITE_P(StatefulNamingFunctor, StatefulNamingTest, Range(0, 5),
class Unstreamable {
public:
explicit Unstreamable(int value) : value_(value) {}
+ // -Wunused-private-field: dummy accessor for `value_`.
+ const int& dummy_value() const { return value_; }
private:
int value_;