Summary:
This check flags all usages of static_cast, where a base class is casted
to a derived class.
In those cases, a fixit is provided to convert the cast to a
dynamic_cast.
Use of these casts can violate type safety and cause the program to
access a variable that is actually of type X to be accessed as if it
were of an unrelated type Z.
This rule is part of the "Type safety" profile of the C++ Core
Guidelines, see
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#-type2-dont-use-static_cast-downcasts-use-dynamic_cast-instead
Depends on D13313
Reviewers: alexfh, sbenza, bkramer, aaron.ballman
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D13368
llvm-svn: 250098
Summary: Replace references to "transform" with references to "check" where neccessary in the documentation.
Reviewers: alexfh
Subscribers: cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D13006
llvm-svn: 248153
containers.
Summary:
sizeof(some_std_string) is likely to be an error. This check finds this
pattern and suggests using .size() instead.
Reviewers: djasper, klimek, aaron.ballman
Subscribers: aaron.ballman, cfe-commits
Differential Revision: http://reviews.llvm.org/D12759
llvm-svn: 247297
This is first of series of patches, porting code from my project colobot-lint,
as I mentioned recently in cfe-dev mailing list.
This patch adds a new check in readability module:
readability-inconsistent-declaration-parameter-name. I also added appropriate
testcases and documentation.
I chose readability module, as it seems it is the best place for it.
I think I followed the rules of LLVM coding guideline, but I may have missed
something, as I usually use other code formatting style.
http://reviews.llvm.org/D12462
Patch by Piotr Dziwinski!
llvm-svn: 247261
The doc files for checks have been generated from the corresponding header files
using the docs/clang-tidy/tools/dump_check_docs.py script. Committing the script
as well, but the intention is to move all the user-facing docs from header files
to the rST files and add links to .h files appropriately.
llvm-svn: 246173