From cf10f9cc357e8c5300758d9347571aeed085ed0b Mon Sep 17 00:00:00 2001 From: Mathew Sutcliffe Date: Wed, 26 Mar 2014 13:34:13 +0000 Subject: [PATCH] fixed new compiler error due to MSVC incorrect handling of capturing the this pointer in a lambda inside another lambda --- tests/blackcore/expect.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/blackcore/expect.h b/tests/blackcore/expect.h index 87e907484..81bef25ce 100644 --- a/tests/blackcore/expect.h +++ b/tests/blackcore/expect.h @@ -87,12 +87,13 @@ public: template ExpectUnit& expect(F1 signal, F2 slot) { auto subj = subject(); + auto next = [=]{ this->next(); }; m_expects.push_back([=]{ m_waitingFor = subj->metaObject()->className(); m_waitingFor += "::"; m_waitingFor += QMetaMethod::fromSignal(signal).name(); m_guard += QObject::connect(subj, signal, slot); - m_guard += QObject::connect(subj, signal, [=]{ next(); }); + m_guard += QObject::connect(subj, signal, next); }); return *this; }