[PATCH] D73367: [clangd] Go-to-definition on 'override' jumps to overridden method(s)

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 27 07:25:42 PST 2020


kadircet added a comment.

please fix clang-format and tidy warnings



================
Comment at: clang-tools-extra/clangd/XRefs.cpp:287
+        // We may be overridding multiple methods - offer them all.
+        for (const NamedDecl* ND : CMD->overridden_methods()) {
+          AddResultDecl(ND);
----------------
when do we have `OverrideAttribute` but no `overriden_methods` ? It looks like

```
struct Foo { virtual void foo(); };
struct Bar {
  void foo() override;
  void bar() override;
};
```

`Bar::bar` doesn't seem to have `OverrideAttr` set for example:
```
|-CXXMethodDecl 0x8e57e88 <line:6:3, col:14> col:8 bar 'void ()'
|-CXXMethodDecl 0x8e57fa0 <line:7:3, col:14> col:8 foo 'void ()'
| |-Overrides: [ 0x8e57668 Foo::foo 'void ()' ]
  | `-OverrideAttr 0x8e58040 <col:14>
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73367/new/

https://reviews.llvm.org/D73367





More information about the cfe-commits mailing list