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
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;
}