#include "index/SymbolLocation.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Attr.h"
+#include "clang/AST/Attrs.inc"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclTemplate.h"
for (const NamedDecl *D : getDeclAtPosition(AST, SourceLoc, Relations)) {
// Special case: void foo() ^override: jump to the overridden method.
if (const auto *CMD = llvm::dyn_cast<CXXMethodDecl>(D)) {
- const auto *Attr = D->getAttr<OverrideAttr>();
+ const InheritableAttr* Attr = D->getAttr<OverrideAttr>();
+ if (!Attr)
+ Attr = D->getAttr<FinalAttr>();
const syntax::Token *Tok =
spelledIdentifierTouching(SourceLoc, AST.getTokens());
if (Attr && Tok &&
class X : Y { void a() ^override {} };
)cpp",
+ R"cpp(// Final specifier jumps to overridden method
+ class Y { virtual void $decl[[a]]() = 0; };
+ class X : Y { void a() ^final {} };
+ )cpp",
+
R"cpp(// Heuristic resolution of dependent method
template <typename T>
struct S {