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 <vector>. 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.
Thank you for reporting this. Should be fixed in r255431.
Thank you for fixes! However some problems remains. 1) There is discrepancy in number of warnings between vector stub and GCC 4.8 STL implementation: 26 warnings with 5 suppressed vs. 22 warnings and 1 suppressed. 2) Check doesn't report warnings with LLVM STL implementation is used. See bug 25804 for analysis of similar problem.
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 think once inline namespaces are supported by hasName, and this is the only difference that cause issues, it should be ok to not test this on every STL related checks.
(In reply to comment #5) > 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 think once inline namespaces are supported by hasName, and this is the > only difference that cause issues, it should be ok to not test this on every > STL related checks. 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?
Created attachment 15857 [details] Proprocessed source Just in case, I used next Clang command-line parameters in addition to -o and -c: -std=c++11 -stdlib=libc++.
I think problem happens because of next size() attribute: __attribute__ ((__visibility__("hidden"), __always_inline__))
Should be fixed by r260217.
Thank you for quick fix!