MaskRay / ccls

C/C++/ObjC language server supporting cross references, hierarchies, completion and semantic highlighting
Apache License 2.0
3.73k stars 254 forks source link

failure to rename overridden virtual functions #909

Open Jacob-Burckhardt opened 1 year ago

Jacob-Burckhardt commented 1 year ago

Observed behavior

With the cursor on the word joe on line 2, I right-clicked and selected Rename. It failed to rename joe on line 6. Since my program compiled before the rename, ccls should leave my program in a state of successful compilation after the rename.

struct Blob {
   virtual void joe() {} // line 2
};

struct Chunk : public Blob {
   virtual void joe() override {} // line 6
};

int main() {}

Expected behavior

It should have renamed joe on line 6.

Steps to reproduce

  1. Put the cursor on "joe" on line 2.
  2. In emacs, right-click.
  3. Select "Rename"
  4. Enter joe2
  5. Recompile it.

The compiler says:

a.cpp:6:17: error: 'joe' marked 'override' but does not override any member functions
   virtual void joe() override {} // line 6

System information