Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rtags fails to find call to destructor when shared_ptr reference count drops to zero #1426

Open
Jacob-Burckhardt opened this issue Oct 6, 2021 · 0 comments

Comments

@Jacob-Burckhardt
Copy link

Jacob-Burckhardt commented Oct 6, 2021

When I put the cursor on ~Blob, and run M-x rtags-find-references-at-point, it fails to find the reference in the shared_ptr class. When the second variable "p" is destructed the reference count drops to zero and the shared_ptr class calls ~Blob. Please make it find the reference at the point when the shared_ptr is destructed on the line with the comment saying "// missing reference to ~Blob".

#include <memory>
#include <iostream>

using namespace std;

struct Blob {
   ~Blob() {
      cout << "In dtor" << endl;
   }
};

int main() {
   {
      auto p = new Blob;
      delete p;
   }
   {
      auto p = std::make_shared<Blob>();
   } // missing reference to ~Blob
}

Environment (please complete the following information):

  • OS/Version: Debian 11
  • RTags(rdm,rc): 2.41.134
  • Emacs: 27.1
  • LLVM/Clang: clang version 11.0.1-2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant