forked from OSchip/llvm-project
Fix the RecursiveASTVisitor to not traverse C++ default parameters twice.
llvm-svn: 150651
This commit is contained in:
parent
ffbf9f1406
commit
85620ad239
|
@ -1663,7 +1663,9 @@ DEF_TRAVERSE_DECL(CXXDestructorDecl, {
|
|||
template<typename Derived>
|
||||
bool RecursiveASTVisitor<Derived>::TraverseVarHelper(VarDecl *D) {
|
||||
TRY_TO(TraverseDeclaratorHelper(D));
|
||||
TRY_TO(TraverseStmt(D->getInit()));
|
||||
// Default params are taken care of when we traverse the ParmVarDecl.
|
||||
if (!isa<ParmVarDecl>(D))
|
||||
TRY_TO(TraverseStmt(D->getInit()));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -107,3 +107,4 @@ void foo4(int p = default_param);
|
|||
|
||||
// CHECK: [indexEntityReference]: kind: variable | name: array_size | {{.*}} | loc: 59:22
|
||||
// CHECK: [indexEntityReference]: kind: variable | name: default_param | {{.*}} | loc: 62:19
|
||||
// CHECK-NOT: [indexEntityReference]: kind: variable | name: default_param | {{.*}} | loc: 62:19
|
||||
|
|
Loading…
Reference in New Issue