Fix build with clang-5.0
refs: #4547
Change-Id: I7fd0411b3dc7c62651875aa035bbfb6ca269bf81
diff --git a/src/nlsr.cpp b/src/nlsr.cpp
index 384d4e9..71970ec 100644
--- a/src/nlsr.cpp
+++ b/src/nlsr.cpp
@@ -165,13 +165,13 @@
{
if (currentNeighbor != m_adjacencyList.getAdjList().end()) {
ndn::FaceUri uri(currentNeighbor->getFaceUri());
- uri.canonize([this, then, currentNeighbor] (ndn::FaceUri canonicalUri) {
+ uri.canonize([then, currentNeighbor] (ndn::FaceUri canonicalUri) {
NLSR_LOG_DEBUG("Canonized URI: " << currentNeighbor->getFaceUri()
<< " to: " << canonicalUri);
currentNeighbor->setFaceUri(canonicalUri);
then(std::next(currentNeighbor));
},
- [this, then, currentNeighbor] (const std::string& reason) {
+ [then, currentNeighbor] (const std::string& reason) {
NLSR_LOG_ERROR("Could not canonize URI: " << currentNeighbor->getFaceUri()
<< " because: " << reason);
then(std::next(currentNeighbor));
diff --git a/tests/test-fib.cpp b/tests/test-fib.cpp
index d47d3a8..629f933 100644
--- a/tests/test-fib.cpp
+++ b/tests/test-fib.cpp
@@ -308,8 +308,8 @@
int origSeqNo = fe.getSeqNo();
fib->scheduleEntryRefresh(fe,
- [&, this] (FibEntry& entry) {
- BOOST_CHECK_EQUAL(origSeqNo+1, entry.getSeqNo());
+ [&] (FibEntry& entry) {
+ BOOST_CHECK_EQUAL(origSeqNo + 1, entry.getSeqNo());
});
this->advanceClocks(ndn::time::milliseconds(10), 1);
}
diff --git a/tests/test-nlsr.cpp b/tests/test-nlsr.cpp
index 5c91312..efab71f 100644
--- a/tests/test-nlsr.cpp
+++ b/tests/test-nlsr.cpp
@@ -452,8 +452,7 @@
nlsr.canonizeNeighborUris(iterator, thenCallback, finallyCallback);
};
nlsr.canonizeNeighborUris(nlsr.getAdjacencyList().getAdjList().begin(),
- [&thenCallback, &finallyCallback]
- (std::list<Adjacent>::iterator iterator) {
+ [&] (std::list<Adjacent>::iterator iterator) {
thenCallback(iterator);
},
finallyCallback);
diff --git a/tests/test-sync-logic-handler.cpp b/tests/test-sync-logic-handler.cpp
index b233b22..9f8192e 100644
--- a/tests/test-sync-logic-handler.cpp
+++ b/tests/test-sync-logic-handler.cpp
@@ -111,7 +111,7 @@
// Actual testing done here -- signal function callback
ndn::util::signal::ScopedConnection connection = sync.onNewLsa->connect(
- [&, this] (const ndn::Name& routerName, const uint64_t& sequenceNumber) {
+ [&] (const ndn::Name& routerName, const uint64_t& sequenceNumber) {
BOOST_CHECK_EQUAL(ndn::Name{updateName}, routerName);
BOOST_CHECK_EQUAL(sequenceNumber, syncSeqNo);
});
@@ -139,7 +139,7 @@
+ OTHER_ROUTER_NAME + std::to_string(lsaType);
ndn::util::signal::ScopedConnection connection = sync.onNewLsa->connect(
- [& ,this] (const ndn::Name& routerName, const uint64_t& sequenceNumber) {
+ [&] (const ndn::Name& routerName, const uint64_t& sequenceNumber) {
BOOST_CHECK_EQUAL(ndn::Name{updateName}, routerName);
BOOST_CHECK_EQUAL(sequenceNumber, syncSeqNo);
});
@@ -166,7 +166,7 @@
+ OTHER_ROUTER_NAME + std::to_string(lsaType);
ndn::util::signal::ScopedConnection connection = sync.onNewLsa->connect(
- [& ,this] (const ndn::Name& routerName, const uint64_t& sequenceNumber) {
+ [&] (const ndn::Name& routerName, const uint64_t& sequenceNumber) {
BOOST_CHECK_EQUAL(ndn::Name{updateName}, routerName);
BOOST_CHECK_EQUAL(sequenceNumber, syncSeqNo);
});
@@ -193,7 +193,7 @@
updateName.append(CONFIG_SITE).append(CONFIG_ROUTER_NAME).append(std::to_string(lsaType));
ndn::util::signal::ScopedConnection connection = sync.onNewLsa->connect(
- [& ,this] (const ndn::Name& routerName, const uint64_t& sequenceNumber) {
+ [&] (const ndn::Name& routerName, const uint64_t& sequenceNumber) {
BOOST_FAIL("Updates for self should not be emitted!");
});
@@ -217,7 +217,7 @@
updateName.append(CONFIG_ROUTER_NAME).append(std::to_string(lsaType));
ndn::util::signal::ScopedConnection connection = sync.onNewLsa->connect(
- [& ,this] (const ndn::Name& routerName, const uint64_t& sequenceNumber) {
+ [&] (const ndn::Name& routerName, const uint64_t& sequenceNumber) {
BOOST_FAIL("Malformed updates should not be emitted!");
});
@@ -240,7 +240,7 @@
SyncLogicHandler sync{face, testLsaAlwaysFalse, conf};
sync.createSyncSocket(conf.getChronosyncPrefix());
ndn::util::signal::ScopedConnection connection = sync.onNewLsa->connect(
- [& ,this] (const ndn::Name& routerName, const uint64_t& sequenceNumber) {
+ [&] (const ndn::Name& routerName, const uint64_t& sequenceNumber) {
BOOST_FAIL("An update for an LSA with non-new sequence number should not emit!");
});