Skip to content

Commit a486793

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 b8c604c commit a486793

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
//
@@ -63,7 +63,8 @@ class Functor1
6363

6464
std::string operator()(int i) { return (i < 0) ? "negative" : ((i > 0) ? "positive" : "zero"); }
6565

66-
private:
66+
protected:
67+
// Don't make it private. clang++ does not like unused private data.
6768
const bar_group4& bar_;
6869
};
6970

@@ -82,8 +83,10 @@ class Functor2
8283
return result;
8384
}
8485

85-
private:
86+
protected:
87+
// Don't make it private. clang++ does not like unused private data.
8688
const bar_group4& bar_;
89+
private:
8790
const book& aBook_;
8891
};
8992

0 commit comments

Comments
 (0)