diff options
author | Reid Kleckner <rnk@google.com> | 2016-11-28 23:58:04 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2016-11-28 23:58:04 +0000 |
commit | 9e749f663647545fd897e516cee57d19c3daeca5 (patch) | |
tree | 8262230c47aadd182677cfcb27f72e2747a391c4 | |
parent | 2bd32b05fb25af269ca867e6838076c5cc69bbb7 (diff) | |
download | bcm5719-llvm-9e749f663647545fd897e516cee57d19c3daeca5.tar.gz bcm5719-llvm-9e749f663647545fd897e516cee57d19c3daeca5.zip |
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.
llvm-svn: 288089
-rw-r--r-- | clang/unittests/Tooling/LookupTest.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/unittests/Tooling/LookupTest.cpp b/clang/unittests/Tooling/LookupTest.cpp index 632acbe4ba4..cc3922d01b5 100644 --- a/clang/unittests/Tooling/LookupTest.cpp +++ b/clang/unittests/Tooling/LookupTest.cpp @@ -13,18 +13,19 @@ using namespace clang; namespace { struct GetDeclsVisitor : TestVisitor<GetDeclsVisitor> { - std::function<void(CallExpr *)> OnCall = [&](CallExpr *Expr) {}; - std::function<void(RecordTypeLoc)> OnRecordTypeLoc = [&](RecordTypeLoc Type) { - }; + std::function<void(CallExpr *)> OnCall; + std::function<void(RecordTypeLoc)> OnRecordTypeLoc; SmallVector<Decl *, 4> 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; } |