aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Index/IndexBody.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Index/IndexBody.cpp')
-rw-r--r--clang/lib/Index/IndexBody.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/clang/lib/Index/IndexBody.cpp b/clang/lib/Index/IndexBody.cpp
index fa35f749d028..eb8905a7459c 100644
--- a/clang/lib/Index/IndexBody.cpp
+++ b/clang/lib/Index/IndexBody.cpp
@@ -7,8 +7,12 @@
//===----------------------------------------------------------------------===//
#include "IndexingContext.h"
-#include "clang/AST/RecursiveASTVisitor.h"
+#include "clang/AST/ASTConcept.h"
#include "clang/AST/ASTLambda.h"
+#include "clang/AST/DeclCXX.h"
+#include "clang/AST/ExprConcepts.h"
+#include "clang/AST/RecursiveASTVisitor.h"
+#include "clang/AST/Type.h"
using namespace clang;
using namespace clang::index;
@@ -455,10 +459,10 @@ public:
}
bool VisitParmVarDecl(ParmVarDecl* D) {
- // Index the parameters of lambda expression.
+ // Index the parameters of lambda expression and requires expression.
if (IndexCtx.shouldIndexFunctionLocalSymbols()) {
const auto *DC = D->getDeclContext();
- if (DC && isLambdaCallOperator(DC))
+ if (DC && (isLambdaCallOperator(DC) || isa<RequiresExprBodyDecl>(DC)))
IndexCtx.handleDecl(D);
}
return true;
@@ -472,6 +476,18 @@ public:
Relations, E);
return true;
}
+
+ bool VisitConceptSpecializationExpr(ConceptSpecializationExpr *R) {
+ IndexCtx.handleReference(R->getNamedConcept(), R->getConceptNameLoc(),
+ Parent, ParentDC);
+ return true;
+ }
+
+ bool TraverseTypeConstraint(const TypeConstraint *C) {
+ IndexCtx.handleReference(C->getNamedConcept(), C->getConceptNameLoc(),
+ Parent, ParentDC);
+ return RecursiveASTVisitor::TraverseTypeConstraint(C);
+ }
};
} // anonymous namespace