From 0d8977c1408c28d3ebe5a5f65ceeab1db6572d89 Mon Sep 17 00:00:00 2001 From: Martin Bohme Date: Tue, 26 Jul 2016 16:01:55 +0000 Subject: [PATCH] Revert "Make RecursiveASTVisitor visit lambda capture initialization expressions" This reverts commit r276755. (Broke clang-tidy check modernize-loop-convert.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@276759 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/RecursiveASTVisitor.h | 3 --- unittests/Tooling/RecursiveASTVisitorTestExprVisitor.cpp | 8 -------- 2 files changed, 11 deletions(-) diff --git a/include/clang/AST/RecursiveASTVisitor.h b/include/clang/AST/RecursiveASTVisitor.h index 8c49785cd0..71d7d19fed 100644 --- a/include/clang/AST/RecursiveASTVisitor.h +++ b/include/clang/AST/RecursiveASTVisitor.h @@ -2266,9 +2266,6 @@ DEF_TRAVERSE_STMT(LambdaExpr, { C != CEnd; ++C) { TRY_TO(TraverseLambdaCapture(S, C)); } - for (Expr *Init : S->capture_inits()) { - TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(Init); - } TypeLoc TL = S->getCallOperator()->getTypeSourceInfo()->getTypeLoc(); FunctionProtoTypeLoc Proto = TL.castAs(); diff --git a/unittests/Tooling/RecursiveASTVisitorTestExprVisitor.cpp b/unittests/Tooling/RecursiveASTVisitorTestExprVisitor.cpp index d39ca4b39a..7b62fc1571 100644 --- a/unittests/Tooling/RecursiveASTVisitorTestExprVisitor.cpp +++ b/unittests/Tooling/RecursiveASTVisitorTestExprVisitor.cpp @@ -191,14 +191,6 @@ TEST(RecursiveASTVisitor, VisitsCallExpr) { "void x(); void y() { x(); }")); } -TEST(RecursiveASTVisitor, VisitsLambdaCaptureInit) { - DeclRefExprVisitor Visitor; - Visitor.ExpectMatch("i", 1, 20); - EXPECT_TRUE(Visitor.runOver( - "void f() { int i; [i]{}; };", - DeclRefExprVisitor::Lang_CXX11)); -} - /* FIXME: According to Richard Smith this is a bug in the AST. TEST(RecursiveASTVisitor, VisitsBaseClassTemplateArgumentsInInstantiation) { DeclRefExprVisitor Visitor; -- 2.40.0