diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2015-11-16 19:17:43 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2015-11-16 19:17:43 +0000 |
commit | 5a786ddf4c69b3f24620fc2313febc290745740a (patch) | |
tree | f3ac4ad245905cbc21cc557dffda370e36a23843 /clang-tools-extra/docs/clang-tidy | |
parent | c397b26790871ea0be6fa7dfdd860c2584560e8f (diff) | |
download | bcm5719-llvm-5a786ddf4c69b3f24620fc2313febc290745740a.tar.gz bcm5719-llvm-5a786ddf4c69b3f24620fc2313febc290745740a.zip |
Add a new clang-tidy checker that flags throw expressions whose thrown type is not nothrow copy constructible. While the compiler is free to elide copy constructor calls in some cases, it is under no obligation to do so, which makes the code a portability concern as well as a security concern.
This checker corresponds to the CERT secure coding rule: https://www.securecoding.cert.org/confluence/display/cplusplus/ERR60-CPP.+Exception+objects+must+be+nothrow+copy+constructible
llvm-svn: 253246
Diffstat (limited to 'clang-tools-extra/docs/clang-tidy')
-rw-r--r-- | clang-tools-extra/docs/clang-tidy/checks/cert-thrown-exception-type.rst | 9 | ||||
-rw-r--r-- | clang-tools-extra/docs/clang-tidy/checks/list.rst | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/clang-tools-extra/docs/clang-tidy/checks/cert-thrown-exception-type.rst b/clang-tools-extra/docs/clang-tidy/checks/cert-thrown-exception-type.rst new file mode 100644 index 00000000000..ef05e4f9f1b --- /dev/null +++ b/clang-tools-extra/docs/clang-tidy/checks/cert-thrown-exception-type.rst @@ -0,0 +1,9 @@ +cert-err60-cpp +============== + +This check flags all throw expressions where the exception object is not nothrow +copy constructible. + +This check corresponds to the CERT C++ Coding Standard rule +`ERR60-CPP. Exception objects must be nothrow copy constructible +<https://www.securecoding.cert.org/confluence/display/cplusplus/ERR60-CPP.+Exception+objects+must+be+nothrow+copy+constructible>`_. diff --git a/clang-tools-extra/docs/clang-tidy/checks/list.rst b/clang-tools-extra/docs/clang-tidy/checks/list.rst index b492b927c31..49117797689 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/list.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/list.rst @@ -3,6 +3,7 @@ List of clang-tidy Checks .. toctree:: cert-setlongjmp + cert-thrown-exception-type cert-variadic-function-def cppcoreguidelines-pro-bounds-array-to-pointer-decay cppcoreguidelines-pro-bounds-pointer-arithmetic |