From: Reid Kleckner Date: Mon, 28 Nov 2016 23:58:04 +0000 (+0000) Subject: Avoid lambdas in default member initializers to work around clang bug X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7bccb0f026d47afb8e8235fbe6696c3a7b62a92a;p=clang Avoid lambdas in default member initializers to work around clang bug On Windows, Clang is mangling lambdas in default member initializers incorrectly. See PR31197. This is causing redness on the self-host bots. Work around the problem locally so we aren't blind to further issues. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288089 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/unittests/Tooling/LookupTest.cpp b/unittests/Tooling/LookupTest.cpp index 632acbe4ba..cc3922d01b 100644 --- a/unittests/Tooling/LookupTest.cpp +++ b/unittests/Tooling/LookupTest.cpp @@ -13,18 +13,19 @@ using namespace clang; namespace { struct GetDeclsVisitor : TestVisitor { - std::function OnCall = [&](CallExpr *Expr) {}; - std::function OnRecordTypeLoc = [&](RecordTypeLoc Type) { - }; + std::function OnCall; + std::function OnRecordTypeLoc; SmallVector DeclStack; bool VisitCallExpr(CallExpr *Expr) { - OnCall(Expr); + if (OnCall) + OnCall(Expr); return true; } bool VisitRecordTypeLoc(RecordTypeLoc Loc) { - OnRecordTypeLoc(Loc); + if (OnRecordTypeLoc) + OnRecordTypeLoc(Loc); return true; }