зеркало из https://github.com/microsoft/clang-1.git
[libclang] Allow indexing/get-cursor/etc. for the exception variable in a C++ catch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145750 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
51f5120905
Коммит
dcbb2fb871
|
@ -33,6 +33,11 @@ struct YDerived : Y {
|
|||
|
||||
void test() {
|
||||
X foo;
|
||||
|
||||
try {
|
||||
} catch (X e) {
|
||||
X x;
|
||||
}
|
||||
}
|
||||
|
||||
// RUN: c-index-test -cursor-at=%s:6:4 %s | FileCheck -check-prefix=CHECK-COMPLETION-1 %s
|
||||
|
@ -80,3 +85,7 @@ void test() {
|
|||
// RUN: c-index-test -cursor-at=%s:21:3 %s | FileCheck -check-prefix=CHECK-MEMBER %s
|
||||
// CHECK-MEMBER: FieldDecl=member:21:7 (Definition)
|
||||
// CHECK-MEMBER-NEXT: Completion string: {ResultType int}{TypedText member}
|
||||
|
||||
// RUN: c-index-test -cursor-at=%s:38:12 -cursor-at=%s:39:5 %s | FileCheck -check-prefix=CHECK-CXXCATCH %s
|
||||
// CHECK-CXXCATCH: TypeRef=struct X:3:8
|
||||
// CHECK-CXXCATCH-NEXT: TypeRef=struct X:3:8
|
||||
|
|
|
@ -1737,6 +1737,7 @@ public:
|
|||
void VisitCXXTypeidExpr(CXXTypeidExpr *E);
|
||||
void VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E);
|
||||
void VisitCXXUuidofExpr(CXXUuidofExpr *E);
|
||||
void VisitCXXCatchStmt(CXXCatchStmt *S);
|
||||
void VisitDeclRefExpr(DeclRefExpr *D);
|
||||
void VisitDeclStmt(DeclStmt *S);
|
||||
void VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E);
|
||||
|
@ -1909,6 +1910,12 @@ void EnqueueVisitor::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
|
|||
if (E->isTypeOperand())
|
||||
AddTypeLoc(E->getTypeOperandSourceInfo());
|
||||
}
|
||||
|
||||
void EnqueueVisitor::VisitCXXCatchStmt(CXXCatchStmt *S) {
|
||||
EnqueueChildren(S);
|
||||
AddDecl(S->getExceptionDecl());
|
||||
}
|
||||
|
||||
void EnqueueVisitor::VisitDeclRefExpr(DeclRefExpr *DR) {
|
||||
if (DR->hasExplicitTemplateArgs()) {
|
||||
AddExplicitTemplateArgs(&DR->getExplicitTemplateArgs());
|
||||
|
|
Загрузка…
Ссылка в новой задаче