-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
readability-container-size-empty doesn't work as intended with real vector #26186
Comments
assigned to @Xazax-hun |
Thank you for reporting this. Should be fixed in r255431. |
Thank you for fixes! However some problems remains.
|
Unfortunately I could not reproduce, but I have a different version of GCC STL installed. Can you retest it once http://reviews.llvm.org/D15506 is committed? |
In case libc++ and libstdc++ differ enough for the check to only work on one of them, we need to add tests with the mocks simulating both libraries. |
I do not fully agree. In case the difference is the result of the usage of inline namespaces, then every STL related checks would have duplicated mocks. |
I agree, if the use of inline namespaces is the only difference, then we don't need separate mocks in each test (though testing this at least in one place seems useful). |
I tried r259898 but check still didn't work for libc++. |
Could you upload a preprocessed source file to reproduce the error? |
Proprocessed source |
I think problem happens because of next size() attribute: attribute ((visibility("hidden"), always_inline)) |
Should be fixed by r260217. |
Thank you for quick fix! |
Extended Description
I run trunk Clang-tidy with readability-container-size-empty check on LLDB code.
This check missed vector.size() == 0 in source/Target/ThreadPlanTracer.cpp.
I tried standard test readability-container-size-empty.cpp with real vector by replacing local definition with #include .
Check didn't report anything when compiled with "-stdlib=libc++ -lc++abi -lc++" and only 4 warnings when compiled with "-stdlib=libstdc++ --gcc-toolchain=<path to GCC 4.8.3>".
Will be good idea to try other containers too.
The text was updated successfully, but these errors were encountered: