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

Issues with declaration (statements) #178

Closed
oxisto opened this issue Jul 22, 2020 · 3 comments · Fixed by #179
Closed

Issues with declaration (statements) #178

oxisto opened this issue Jul 22, 2020 · 3 comments · Fixed by #179
Assignees
Labels
bug Something isn't working cxx Related to C/C++ language parsing

Comments

@oxisto
Copy link
Member

oxisto commented Jul 22, 2020

There are two issues with declaration statements or declaration sequences. The first one is, that it seems that all declarations in a sequence are assigned the same type. However, this is not entirely correct, if you look at:

int *a, b;

This actually should declare two variables, one with type int* and one with type int. In our CPG, both variables have type int*, which is incorrect.

Second issue is regarding class types that are declared within a simple declaration, i.e.

class A {

} myA;

While the CPG correctly parses the type of the variable myA as A, the declaration statement (if used in a function) only contains a variable declaration for myA, but it should also contain a record declaration for A.

@oxisto oxisto added the cxx Related to C/C++ language parsing label Jul 22, 2020
@Masrepus
Copy link
Contributor

Haha what, you can declare classes in this way? 😅

@oxisto
Copy link
Member Author

oxisto commented Jul 22, 2020

Yeah... to be honest, I also did not know that before looking at the C++ reference. Weird language.

@oxisto oxisto added the bug Something isn't working label Jul 22, 2020
@oxisto oxisto self-assigned this Jul 22, 2020
@oxisto
Copy link
Member Author

oxisto commented Jul 22, 2020

Ok it looks like my original test was wrong and the first issue is already solved, the second one is still there though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cxx Related to C/C++ language parsing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants