summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjell Ahlstedt <kjellahlstedt@gmail.com>2019-07-03 17:30:13 +0200
committerKjell Ahlstedt <kjellahlstedt@gmail.com>2019-07-03 17:30:13 +0200
commita486793ce877d990d4000298f83e7712fedf68b9 (patch)
treed4727c4b222f25648acfc3c745f32f31275eea80
parentb8c604ce24182b1c6014714b3909136997328921 (diff)
downloadsigc++-a486793ce877d990d4000298f83e7712fedf68b9.tar.gz
tests/test_track_obj: Fix for clang++
clang++ complains if private members are unused, so make them protected. error: private field 'bar_' is not used [-Werror,-Wunused-private-field]
-rw-r--r--tests/test_track_obj.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/test_track_obj.cc b/tests/test_track_obj.cc
index 1c93b69..0680508 100644
--- a/tests/test_track_obj.cc
+++ b/tests/test_track_obj.cc
@@ -21,8 +21,8 @@
// - Show that a slot with a C++11 lambda expression can be automatically
// disconnected when an object derived from sigc::trackable is deleted,
// provided sigc::track_obj() is used.
-// It's shown here as a preparation for deprecating and eventually
-// deleting the libsigc++ lambda expressions.
+// It shows that C++11 lambda expressions can replace the libsigc++ lambda
+// expressions, which have been removed.
// See https://bugzilla.gnome.org/show_bug.cgi?id=672555
// - Test the code example in the documentation in sigc++/adaptors/track_obj.h.
//
@@ -63,7 +63,8 @@ public:
std::string operator()(int i) { return (i < 0) ? "negative" : ((i > 0) ? "positive" : "zero"); }
-private:
+protected:
+ // Don't make it private. clang++ does not like unused private data.
const bar_group4& bar_;
};
@@ -82,8 +83,10 @@ public:
return result;
}
-private:
+protected:
+ // Don't make it private. clang++ does not like unused private data.
const bar_group4& bar_;
+private:
const book& aBook_;
};