ccls icon indicating copy to clipboard operation
ccls copied to clipboard

failure to rename overridden virtual functions

Open Jacob-Burckhardt opened this issue 3 years ago • 0 comments

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

  • ccls version (built from source, not installed from apt): Debian ccls version 0.20220729-0-g7445891
  • clang version: 11.0.1-2
  • OS: Debian GNU/Linux 11
  • Editor: Emacs 27.1
  • Language client (and version): emacs-ccls; git rev ae74a39

Jacob-Burckhardt avatar Sep 26 '22 23:09 Jacob-Burckhardt