-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
refs #13698 - Library: avoid impossible type lookups #7373
base: main
Are you sure you want to change the base?
Conversation
Okay - this appears to be quite a mess (surprise, surprise). The function declaration stuff has lots of other cases. And I am also seeing function calls getting through which do not seem to be recognized as such. |
aa7134f
to
c212dfc
Compare
I wonder if that is a chicken/egg issue. In the Maybe those type lookups need to be deferred? |
This comment was marked as resolved.
This comment was marked as resolved.
// TODO: this is flawed and might result in lookups like "uint64_tflags_" | ||
std::string typestr = withoutStd ? "std::" : ""; | ||
while (Token::Match(tok, "%name%|::")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chrchr-github could you please have a look at this? Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Off the top of my head, you could try something like this
if (tok->str() == "::")
tok = tok->next();
while (Token::Match(tok, "%name% ::")) {
typestr += tok->str();
typestr += "::";
tok = tok->tokAt(2);
}
if (tok && tok->isName()) {
typestr += tok->str();
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. That's probably as convoluted as what I would have come up with (if I had tried). I was hoping there might be something more straight forward I was missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. That produces proper types to look up. Published in #7378.
No description provided.