[PATCH] D32743: [clang-tidy] Add new cert-dcl21-cpp check.

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 2 04:22:13 PDT 2017


xazax.hun created this revision.
xazax.hun added a project: clang-tools-extra.
Herald added subscribers: whisperity, mgorny.

This check flags postfix ``operator++`` and ``operator--`` declarations, where the return type is not a const value type. It also attempt to fix the error.

This rule is described by cert: https://www.securecoding.cert.org/confluence/display/cplusplus/DCL21-CPP.+Overloaded+postfix+increment+and+decrement+operators+should+return+a+const+object


Repository:
  rL LLVM

https://reviews.llvm.org/D32743

Files:
  clang-tidy/cert/CERTTidyModule.cpp
  clang-tidy/cert/CMakeLists.txt
  clang-tidy/cert/PostfixOperatorCheck.cpp
  clang-tidy/cert/PostfixOperatorCheck.h
  docs/ReleaseNotes.rst
  docs/clang-tidy/checks/cert-dcl21-cpp.rst
  docs/clang-tidy/checks/list.rst
  test/clang-tidy/cert-dcl21-cpp.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32743.97428.patch
Type: text/x-patch
Size: 9609 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170502/dfcfa77e/attachment-0001.bin>


More information about the cfe-commits mailing list