Andersbakken / rtags

A client/server indexer for c/c++/objc[++] with integration for Emacs based on clang.
http://www.rtags.net
GNU General Public License v3.0
1.83k stars 254 forks source link

constructor call not found for member object #1384

Open Jacob-Burckhardt opened 4 years ago

Jacob-Burckhardt commented 4 years ago

When I ask rtags to find calls to the Blob constructor, it fails to find the call on line 7:

class Blob {
public:
   Blob() {}
};

class Chunk {
   Blob b; // line 7
   Blob *p = new Blob; // line 8
};

int main() {
   Chunk c;
}

To Reproduce

This command refers to line 3 column 5 which is the Blob constructor declaration.

/home/bjacob/no_backup/rtags/bin/rc --current-file=/home/bjacob/rtags_test/joe.C -z -t128 -r /home/bjacob/rtags_test/joe.C:3:5:

Actual output:

joe.C:8:18:    Blob *p = new Blob; // line 8

Notice how it found the constructor call on line 8 but not line 7.

Expected output:

joe.C:7:4:     Blob b; // line 7
joe.C:8:18:    Blob *p = new Blob; // line 8

Perhaps the actual Blob constructor call is in the implicit Chunk constructor, so maybe that is what rtags should mention.

Environment (please complete the following information):