Fix -Wunused-private-field issues with clang
Provide dummy accessors for private values that are set in initializers, but not actually used. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
This commit is contained in:
parent
c4ccab33aa
commit
ed2fe122f8
@ -982,6 +982,8 @@ class Unprintable {
|
|||||||
Unprintable() : c_('a') {}
|
Unprintable() : c_('a') {}
|
||||||
|
|
||||||
bool operator==(const Unprintable& /* rhs */) const { return true; }
|
bool operator==(const Unprintable& /* rhs */) const { return true; }
|
||||||
|
// -Wunused-private-field: dummy accessor for `c_`.
|
||||||
|
char dummy_c() { return c_; }
|
||||||
private:
|
private:
|
||||||
char c_;
|
char c_;
|
||||||
};
|
};
|
||||||
|
@ -964,6 +964,8 @@ INSTANTIATE_TEST_SUITE_P(StatefulNamingFunctor, StatefulNamingTest, Range(0, 5),
|
|||||||
class Unstreamable {
|
class Unstreamable {
|
||||||
public:
|
public:
|
||||||
explicit Unstreamable(int value) : value_(value) {}
|
explicit Unstreamable(int value) : value_(value) {}
|
||||||
|
// -Wunused-private-field: dummy accessor for `value_`.
|
||||||
|
const int& dummy_value() const { return value_; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int value_;
|
int value_;
|
||||||
|
Loading…
Reference in New Issue
Block a user