-
Notifications
You must be signed in to change notification settings - Fork 13.3k
misc-string-integer-assignment doesn't work #26507
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
Comments
assigned to @Xazax-hun |
What standard library do you use? With the version of libstdc++ I have on my machine, this seems to work (with the preprocessed file it doesn't): $ cat /tmp/qq.cc int main() { |
Seems to be a problem with inline namespace __cxx11 {} again. Is this exactly the problem that http://reviews.llvm.org/D15506 is meant to solve? |
I think so. |
May I ask you to apply that patch and see whether it fixes the issue? |
Sure! I can confirm that after applying the patch from http://reviews.llvm.org/D15506 the checker can find the two issues in the attached preprocessed file. |
Looking into this patch:
This seems to be quite unexpected behaviour. Isn't just applying regular expressions via using matchesName instead of hasName while leaving hasName with more intuitive behaviour? |
Inline namespaces are often implementation details. I don't think that the checkers should deal with them unless they really want to. And I think it is unreasonable to expect the checker authors to test their checkers with all of the major standard libraries to check whether their regexp is correct for all of them. |
Makes sense. I was about to suggest creating a custom matcher, say, hasNameThroughNamespaces or something less monstrous, but I can't find a scenario, when somebody will want to use the hasName with exact inline etc namespaces matching. |
I can think of one scenario, to warn when a deprecated version of an API is used, that is behind an inline namespace, and the library authors did not add the deprecated attribute to the API. But this is probably very rare. |
Thanks guys, I am waiting till this patch will be upstream. |
What is the status of it?
|
Thanks for fixing! |
Extended Description
Hi guys,
I been recently playing with clang-tidy, and I don't know why but some checks seems to not check for what they should.
I took simple example from docs (included file).
I am sure I am running right checks, because list checks say so.
The text was updated successfully, but these errors were encountered: