Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[C++] data flow node not found #21032

Open
Open
Labels
C++ acknowledgedGitHub staff acknowledges this issue bugSomething isn't working
@hello123leo

Description

g++ version: 4.8.2
codeql version: 2.23.6

main.cpp:

#include "stdint.h"
#include <string>
class Test {
public:
 explicit Test(const uint64_t &id) : id_(id) {}
 
private:
 uint64_t id_;
};
int main(int argc, char* argv[]){
 Test test(123456);
 return 0;
}

create database command:

codeql database create testdb --language=cpp --command='g++ main.cpp -std=c++11' -j 0

query:

from DataFlow::Node n
where n.getLocation().getFile().getBaseName() = "main.cpp"
select n

I can find the data flow node "*constructor init of field id_":

Image

and then i add a string member variable str_ like this(line 9):

#include "stdint.h"
#include <string>
class Test {
public:
 explicit Test(const uint64_t &id) : id_(id) {}
 
private:
 std::string str_{};
 uint64_t id_;
};
int main(int argc, char* argv[]){
 Test test(123456);
 return 0;
}

use the same command to create a new database and the same query to analyze, it seems that i can not find the data flow node "*constructor init of field id_" in the new database.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C++ acknowledgedGitHub staff acknowledges this issue bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /