llvm-project/clang-tools-extra/clang-tidy/cppcoreguidelines
Matthias Gehre 27da23464f [clang-tidy] add check cppcoreguidelines-pro-type-vararg
Summary:
This check flags all calls to c-style vararg functions and all use
of va_list, va_start and va_arg.

Passing to varargs assumes the correct type will be read. This is
fragile because it cannot generally be enforced to be safe in the
language and so relies on programmer discipline to get it right.

This rule is part of the "Type safety" profile of the C++ Core
Guidelines, see
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#-type8-avoid-reading-from-varargs-or-passing-vararg-arguments-prefer-variadic-template-parameters-instead

This commits also reverts
  "[clang-tidy] add cert's VariadicFunctionDefCheck as cppcoreguidelines-pro-type-vararg-def"
because that check makes the SFINAE use of vararg functions impossible.

Reviewers: alexfh, sbenza, bkramer, aaron.ballman

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D13787

llvm-svn: 250939
2015-10-21 20:09:02 +00:00
..
CMakeLists.txt [clang-tidy] add check cppcoreguidelines-pro-type-vararg 2015-10-21 20:09:02 +00:00
CppCoreGuidelinesTidyModule.cpp [clang-tidy] add check cppcoreguidelines-pro-type-vararg 2015-10-21 20:09:02 +00:00
Makefile
ProBoundsPointerArithmeticCheck.cpp [clang-tidy] new check cppcoreguidelines-pro-bounds-pointer-arithmetic 2015-10-12 21:53:19 +00:00
ProBoundsPointerArithmeticCheck.h [clang-tidy] new check cppcoreguidelines-pro-bounds-pointer-arithmetic 2015-10-12 21:53:19 +00:00
ProTypeConstCastCheck.cpp Fixing links and reformatting code; NFC. 2015-10-07 20:33:36 +00:00
ProTypeConstCastCheck.h Fixing links and reformatting code; NFC. 2015-10-07 20:33:36 +00:00
ProTypeReinterpretCastCheck.cpp Fixing links and reformatting code; NFC. 2015-10-07 20:33:36 +00:00
ProTypeReinterpretCastCheck.h Fixing links and reformatting code; NFC. 2015-10-07 20:33:36 +00:00
ProTypeStaticCastDowncastCheck.cpp [clang-tidy] add check cppcoreguidelines-pro-type-static-cast-downcast 2015-10-12 20:46:53 +00:00
ProTypeStaticCastDowncastCheck.h [clang-tidy] add check cppcoreguidelines-pro-type-static-cast-downcast 2015-10-12 20:46:53 +00:00
ProTypeUnionAccessCheck.cpp [clang-tidy] add check cppcoreguidelines-pro-type-union-access 2015-10-16 18:46:30 +00:00
ProTypeUnionAccessCheck.h [clang-tidy] add check cppcoreguidelines-pro-type-union-access 2015-10-16 18:46:30 +00:00
ProTypeVarargCheck.cpp [clang-tidy] add check cppcoreguidelines-pro-type-vararg 2015-10-21 20:09:02 +00:00
ProTypeVarargCheck.h [clang-tidy] add check cppcoreguidelines-pro-type-vararg 2015-10-21 20:09:02 +00:00