summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/cert/StaticObjectExceptionCheck.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Fix false positive with lambda assignments in cert-err58-cpp.Aaron Ballman2018-11-281-1/+2
| | | | | | This check is about preventing exceptions from being thrown before main() executes, and assigning a lambda (rather than calling it) to a global object cannot throw any exceptions. llvm-svn: 347761
* Fix a false-positive with cert-err58-cpp.Aaron Ballman2018-11-281-1/+1
| | | | | | If a variable is declared constexpr then its initializer needs to be a constant expression, and thus, cannot throw. This check is about not throwing exceptions before main() runs, and so it doesn't apply if the initializer cannot throw. This silences the diagnostic when initializing a constexpr variable and fixes PR35457. llvm-svn: 347745
* [clang-tidy] When" -fno-exceptions is used", this warning is better to be ↵Yan Wang2017-06-071-1/+1
| | | | | | | | | | | | | | | | | | suppressed. Summary: clang-tidy is better not to issues this warning, which checks where the initializer for the object may throw an exception, when "-fno-exceptions" is used. Reviewers: chh, aaron.ballman Reviewed By: aaron.ballman Subscribers: xazax.hun Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D33917 llvm-svn: 304931
* [clang-tools-extra] Format sources with clang-format. NFC.Mandeep Singh Grang2016-11-081-1/+1
| | | | | | | | | | | | | | | | Summary: Ran clang-format on all .c/.cpp/.h files in clang-tools-extra. Excluded the test, unittests, clang-reorder-fields, include-fixer, modularize and pptrace directories. Reviewers: klimek, alexfh Subscribers: nemanjai Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D26329 llvm-svn: 286221
* [clang-tidy] Update cert-err58-cpp to match its new generalised form.Malcolm Parsons2016-10-311-8/+18
| | | | | | | | | | | | | | Summary: Aaron modified cert-err58-cpp to include all exceptions thrown before main() Update the check to match. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25925 llvm-svn: 285653
* [clang-tidy] Use ignoreImplicit in cert-err58-cpp checkMalcolm Parsons2016-10-161-2/+2
| | | | | | | | | | | | | | Summary: Fix a false negative in cert-err58-cpp check when calling a constructor creates objects that require cleanup. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25642 llvm-svn: 284332
* Silence a false positive with the cert-err58-cpp check; now allows objects ↵Aaron Ballman2016-09-261-2/+2
| | | | | | | | with static or thread storage duration at function block scope. Patch by Malcolm Parsons llvm-svn: 282409
* Rename the CERT namespace to cert, and update some checkers to use this ↵Aaron Ballman2016-01-041-1/+2
| | | | | | | | namespace consistently. Patch thanks to Haojian Wu! llvm-svn: 256756
* Replace the custom AST matcher for nothrow functions with the canonical AST ↵Aaron Ballman2015-12-021-1/+1
| | | | | | matcher from r254516. llvm-svn: 254517
* Add a new checker, cert-err58-cpp, that checks for static or thread_local ↵Aaron Ballman2015-12-011-0/+49
objects that use a throwing constructor. This check corresponds to the CERT secure coding rule: https://www.securecoding.cert.org/confluence/display/cplusplus/ERR58-CPP.+Constructors+of+objects+with+static+or+thread+storage+duration+must+not+throw+exceptions llvm-svn: 254415
OpenPOWER on IntegriCloud