Skip to content

Commit 5dadaf2

Browse files
committed
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]
1 parent 06fabac commit 5dadaf2

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/test_track_obj.cc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
// - Show that a slot with a C++11 lambda expression can be automatically
2222
// disconnected when an object derived from sigc::trackable is deleted,
2323
// provided sigc::track_obj() is used.
24-
// It's shown here as a preparation for deprecating and eventually
25-
// deleting the libsigc++ lambda expressions.
24+
// It shows that C++11 lambda expressions can replace the libsigc++ lambda
25+
// expressions, which have been removed.
2626
// See https://bugzilla.gnome.org/show_bug.cgi?id=672555
2727
// - Test the code example in the documentation in sigc++/adaptors/track_obj.h.
2828
//
@@ -72,7 +72,8 @@ class Functor1 : public sigc::functor_base
7272
return (i<0) ? "negative" : ((i>0) ? "positive" : "zero");
7373
}
7474

75-
private:
75+
protected:
76+
// Don't make it private. clang++ does not like unused private data.
7677
const bar_group4& bar_;
7778
};
7879

@@ -92,8 +93,10 @@ class Functor2 : public sigc::functor_base
9293
return result;
9394
}
9495

95-
private:
96+
protected:
97+
// Don't make it private. clang++ does not like unused private data.
9698
const bar_group4& bar_;
99+
private:
97100
const book& aBook_;
98101
};
99102

0 commit comments

Comments
 (0)