Selection now includes the virtual and access modifier as part of their range for cxx base specifiers.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D95231
return traverseNode(
X, [&] { return Base::TraverseConstructorInitializer(X); });
}
+ bool TraverseCXXBaseSpecifier(const CXXBaseSpecifier &X) {
+ return traverseNode(&X, [&] { return Base::TraverseCXXBaseSpecifier(X); });
+ }
// Stmt is the same, but this form allows the data recursion optimization.
bool dataTraverseStmtPre(Stmt *X) {
if (!X || isImplicit(X))
}
)cpp",
"new name is the same", !HeaderFile, nullptr, "SameName"},
+ {R"cpp(// Ensure it doesn't associate base specifier with base name.
+ struct A {};
+ struct B : priv^ate A {};
+ )cpp",
+ "Cannot rename symbol: there is no symbol at the given location", false,
+ nullptr},
};
for (const auto& Case : Cases) {
)cpp",
"StringLiteral", // Not DeclRefExpr to operator()!
},
+ {
+ R"cpp(
+ struct Foo {};
+ struct Bar : [[v^ir^tual private Foo]] {};
+ )cpp",
+ "CXXBaseSpecifier",
+ },
+ {
+ R"cpp(
+ struct Foo {};
+ struct Bar : private [[Fo^o]] {};
+ )cpp",
+ "RecordTypeLoc",
+ },
+ {
+ R"cpp(
+ struct Foo {};
+ struct Bar : [[Fo^o]] {};
+ )cpp",
+ "RecordTypeLoc",
+ },
// Point selections.
{"void foo() { [[^foo]](); }", "DeclRefExpr"},
return TAL->getSourceRange();
if (const auto *C = get<OMPClause>())
return SourceRange(C->getBeginLoc(), C->getEndLoc());
+ if (const auto *CBS = get<CXXBaseSpecifier>())
+ return CBS->getSourceRange();
return SourceRange();
}