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

Cleanup in createSymbolDatabaseIncompleteVars() #6238

Merged
merged 6 commits into from
Apr 6, 2024

Conversation

chrchr-github
Copy link
Collaborator

No description provided.

@chrchr-github chrchr-github reopened this Apr 5, 2024
lib/tokenize.cpp Outdated Show resolved Hide resolved
@@ -1524,11 +1463,14 @@ void SymbolDatabase::createSymbolDatabaseIncompleteVars()
tok = tok->link();
continue;
}
if (Token::Match(tok, "catch|typeid (")) {
if (tok->isCpp() && (Token::Match(tok, "catch|typeid (") ||
Token::Match(tok, "static_cast|dynamic_cast|const_cast|reinterpret_cast"))) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not check for the opening (<) unlike the previous condition - is that intentional? Could this be replaced with isCast()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was no explicit handling of C++ casts (and the stuff between <...>) in createSymbolDatabaseIncompleteVars(), so I wonder how that worked.
isCast() is set for (, so that's too late for the target type.
We should also reject a C++ cast keyword not followed by < as a syntax error.

@firewave firewave merged commit a16f360 into danmar:main Apr 6, 2024
64 checks passed
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

Successfully merging this pull request may close these issues.

2 participants