llvm-project/clang-tools-extra/clang-tidy/bugprone
Markus Böck b7d55771ce [clang-tidy][#51939] Exempt placement-new expressions from 'bugprone-throw-keyword-missing'
The purpose of this checker is to flag a missing throw keyword, and does so by checking for the construction of an exception class that is then unused.
This works great except that placement new expressions are also flagged as those lead to the construction of an object as well, even though they are not temporary (as that is dependent on the storage).
This patch fixes the issue by exempting the match if it is within a placement-new.

Fixes https://github.com/llvm/llvm-project/issues/51939

Differential Revision: https://reviews.llvm.org/D115576
2021-12-15 16:59:14 +01:00
..
ArgumentCommentCheck.cpp bugprone-argument-comment: SourceLocation valid judgment avoid emitting coredump in isInSystemHeader 2021-10-13 12:31:02 -04:00
ArgumentCommentCheck.h
AssertSideEffectCheck.cpp [clang-tidy] bugprone-assert-side-effect: Warn on NSAssert by default. 2021-01-28 22:31:49 -08:00
AssertSideEffectCheck.h
BadSignalToKillThreadCheck.cpp [clang-tidy] Applied clang-tidy fixes. NFC 2021-01-29 01:01:19 +01:00
BadSignalToKillThreadCheck.h [clang-tidy] Add bugprone-bad-signal-to-kill-thread check and its alias cert-pos44-c 2019-11-11 17:47:14 +01:00
BoolPointerImplicitConversionCheck.cpp Remove references to the ast_type_traits namespace 2020-12-11 00:58:46 +01:00
BoolPointerImplicitConversionCheck.h
BranchCloneCheck.cpp [clang-tidy] Fix lint warnings in clang-tidy source code (NFC) 2021-11-02 20:14:25 +13:00
BranchCloneCheck.h [llvm][clang][NFC] updates inline licence info 2021-08-11 02:48:53 +00:00
BugproneTidyModule.cpp Add new clang-tidy check for string_view(nullptr) 2021-12-02 13:25:28 +00:00
CMakeLists.txt [clang-tidy] Fix build broken by commit 6a9487df73 (D113148) 2021-12-02 14:41:00 +00:00
CopyConstructorInitCheck.cpp [clang-tidy] Applied clang-tidy fixes. NFC 2021-01-29 01:01:19 +01:00
CopyConstructorInitCheck.h [clang-tidy] Fix lint warnings in clang-tidy source code (NFC) 2021-11-02 20:14:25 +13:00
DanglingHandleCheck.cpp Remove references to the ast_type_traits namespace 2020-12-11 00:58:46 +01:00
DanglingHandleCheck.h
DynamicStaticInitializersCheck.cpp [clang-tidy] Add support for diagnostics with no location 2020-12-08 20:29:31 +00:00
DynamicStaticInitializersCheck.h [clang-tidy] Use ; as separator for HeaderFileExtensions 2020-03-09 11:32:44 -06:00
EasilySwappableParametersCheck.cpp [clang-tidy] Fix lint warnings in clang-tidy source code (NFC) 2021-11-02 20:14:25 +13:00
EasilySwappableParametersCheck.h [clang-tidy] Suppress reports to patternedly named parameters in 'bugprone-easily-swappable-parameters' 2021-06-28 10:49:37 +02:00
ExceptionEscapeCheck.cpp [clang-tidy][NFC] Tweak some generation of diag messages 2021-02-26 19:10:25 +00:00
ExceptionEscapeCheck.h [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
FoldInitTypeCheck.cpp [clang-tools-extra] NFC: Fix trivial typo in documents and comments 2020-04-05 15:28:40 +09:00
FoldInitTypeCheck.h
ForwardDeclarationNamespaceCheck.cpp Use {DenseSet,SetVector,SmallPtrSet}::contains (NFC) 2021-10-30 19:00:19 -07:00
ForwardDeclarationNamespaceCheck.h
ForwardingReferenceOverloadCheck.cpp [clang-tidy] Fix lint warnings in clang-tidy source code (NFC) 2021-11-02 20:14:25 +13:00
ForwardingReferenceOverloadCheck.h [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
ImplicitWideningOfMultiplicationResultCheck.cpp [clang-tidy] Add check for implicit widening of multiplication result 2021-04-13 21:41:22 +03:00
ImplicitWideningOfMultiplicationResultCheck.h [clang-tidy] Add check for implicit widening of multiplication result 2021-04-13 21:41:22 +03:00
InaccurateEraseCheck.cpp [clang-tidy] Simplify inaccurate erase check 2021-02-13 13:51:27 +00:00
InaccurateEraseCheck.h [clang-tidy] Simplify inaccurate erase check 2021-02-13 13:51:27 +00:00
IncorrectRoundingsCheck.cpp [clang-tidy] Applied clang-tidy fixes. NFC 2021-01-29 01:01:19 +01:00
IncorrectRoundingsCheck.h
InfiniteLoopCheck.cpp [clang-tidy] bugprone-infinite-loop: Fix false positives with volatile addresses. 2021-09-07 15:10:46 -07:00
InfiniteLoopCheck.h [clang-tidy] Add missing InfiniteLoopCheck.h, InfiniteLoopCheck.cpp and test from D64736 2019-09-24 09:06:31 +00:00
IntegerDivisionCheck.cpp Remove references to the ast_type_traits namespace 2020-12-11 00:58:46 +01:00
IntegerDivisionCheck.h
LambdaFunctionNameCheck.cpp [clang-tidy] Applied clang-tidy fixes. NFC 2021-01-29 01:01:19 +01:00
LambdaFunctionNameCheck.h
MacroParenthesesCheck.cpp [clang-tidy] Avoid bugprone-macro-parentheses warnings after goto argument 2021-04-22 10:14:10 +03:00
MacroParenthesesCheck.h
MacroRepeatedSideEffectsCheck.cpp Avoid including Builtins.h in Preprocessor.h 2019-11-15 16:45:16 -08:00
MacroRepeatedSideEffectsCheck.h
MisplacedOperatorInStrlenInAllocCheck.cpp Remove references to the ast_type_traits namespace 2020-12-11 00:58:46 +01:00
MisplacedOperatorInStrlenInAllocCheck.h
MisplacedPointerArithmeticInAllocCheck.cpp [clang-tidy] Crash fix for bugprone-misplaced-pointer-arithmetic-in-alloc 2020-09-16 13:16:44 +02:00
MisplacedPointerArithmeticInAllocCheck.h [clang-tidy] New check: bugprone-misplaced-pointer-arithmetic-in-alloc 2020-01-21 14:38:15 +01:00
MisplacedWideningCastCheck.cpp Remove references to the ast_type_traits namespace 2020-12-11 00:58:46 +01:00
MisplacedWideningCastCheck.h
MoveForwardingReferenceCheck.cpp [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
MoveForwardingReferenceCheck.h [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
MultipleStatementMacroCheck.cpp [clang-tidy] Fix lint warnings in clang-tidy source code (NFC) 2021-11-02 20:14:25 +13:00
MultipleStatementMacroCheck.h
NoEscapeCheck.cpp Warn pointer captured in async block 2020-07-07 13:31:14 -04:00
NoEscapeCheck.h Warn pointer captured in async block 2020-07-07 13:31:14 -04:00
NotNullTerminatedResultCheck.cpp [clang-tidy] Applied clang-tidy fixes. NFC 2021-01-29 01:01:19 +01:00
NotNullTerminatedResultCheck.h [clang-tidy][NFC] Remove unnecessary includes throughout clang-tidy header files 2020-06-29 16:05:52 +01:00
ParentVirtualCallCheck.cpp [clang-tidy][NFC] Tweak some generation of diag messages 2021-02-26 19:10:25 +00:00
ParentVirtualCallCheck.h Remove +x permission on some files 2019-11-16 14:47:20 +01:00
PosixReturnCheck.cpp [clang-tidy][NFC] Remove unnecessary includes throughout clang-tidy header files 2020-06-29 16:05:52 +01:00
PosixReturnCheck.h
RedundantBranchConditionCheck.cpp [clang-tidy] Simplify redundant branch condition check 2021-02-27 12:13:23 +00:00
RedundantBranchConditionCheck.h [clang-tidy] Simplify redundant branch condition check 2021-02-27 12:13:23 +00:00
ReservedIdentifierCheck.cpp [clang-tidy] Fix lint warnings in clang-tidy source code (NFC) 2021-11-02 20:14:25 +13:00
ReservedIdentifierCheck.h [clang-tidy] Fix lint warnings in clang-tidy source code (NFC) 2021-11-02 20:14:25 +13:00
SignalHandlerCheck.cpp [clang-tidy] Extending bugprone-signal-handler with POSIX functions. 2021-02-23 14:48:00 +01:00
SignalHandlerCheck.h [clang-tidy] Extending bugprone-signal-handler with POSIX functions. 2021-02-23 14:48:00 +01:00
SignedCharMisuseCheck.cpp Remove references to the ast_type_traits namespace 2020-12-11 00:58:46 +01:00
SignedCharMisuseCheck.h [clang-tidy]: Add cert-str34-c alias for bugprone-signed-char-misuse. 2020-05-06 12:36:01 +02:00
SizeofContainerCheck.cpp [NFC] use hasAnyOperatorName and hasAnyOverloadedOperatorName functions in clang-tidy matchers 2020-03-10 00:42:21 +00:00
SizeofContainerCheck.h
SizeofExpressionCheck.cpp [clang-tidy] Fix lint warnings in clang-tidy source code (NFC) 2021-11-02 20:14:25 +13:00
SizeofExpressionCheck.h
SpuriouslyWakeUpFunctionsCheck.cpp [clang-tidy] Use new mapping matchers 2021-02-03 23:21:17 +00:00
SpuriouslyWakeUpFunctionsCheck.h [clang-tidy] Add spuriously-wake-up-functions check 2020-03-21 12:04:03 +01:00
StringConstructorCheck.cpp [APInt] Stop using soft-deprecated constructors and methods in clang. NFC. 2021-10-04 09:38:11 +01:00
StringConstructorCheck.h [clang-tidy] Extend bugprone-string-constructor-check to std::string_view. 2020-11-18 21:16:03 -05:00
StringIntegerAssignmentCheck.cpp [NFC] use hasAnyOperatorName and hasAnyOverloadedOperatorName functions in clang-tidy matchers 2020-03-10 00:42:21 +00:00
StringIntegerAssignmentCheck.h [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
StringLiteralWithEmbeddedNulCheck.cpp [clang-tidy] Applied clang-tidy fixes. NFC 2021-01-29 01:01:19 +01:00
StringLiteralWithEmbeddedNulCheck.h
StringviewNullptrCheck.cpp Add new clang-tidy check for string_view(nullptr) 2021-12-02 13:25:28 +00:00
StringviewNullptrCheck.h Add new clang-tidy check for string_view(nullptr) 2021-12-02 13:25:28 +00:00
SuspiciousEnumUsageCheck.cpp [clang-tidy] Simplify suspicious enum usage check 2021-02-27 12:11:45 +00:00
SuspiciousEnumUsageCheck.h [clang-tidy] Simplify suspicious enum usage check 2021-02-27 12:11:45 +00:00
SuspiciousIncludeCheck.cpp [clang-tidy] Add support for diagnostics with no location 2020-12-08 20:29:31 +00:00
SuspiciousIncludeCheck.h [clang-tidy] New check: bugprone-suspicious-include 2020-03-12 09:59:28 -06:00
SuspiciousMemoryComparisonCheck.cpp [clang-tidy] Add bugprone-suspicious-memory-comparison check 2021-08-26 09:23:37 +02:00
SuspiciousMemoryComparisonCheck.h [clang-tidy] Add bugprone-suspicious-memory-comparison check 2021-08-26 09:23:37 +02:00
SuspiciousMemsetUsageCheck.cpp [clang-tidy] Fix a crash on invalid code for memset-usage check. 2021-05-19 09:53:18 +02:00
SuspiciousMemsetUsageCheck.h [clang-tidy] Simplify suspicious memset usage check 2021-02-27 12:17:09 +00:00
SuspiciousMissingCommaCheck.cpp [clang-tidy] Applied clang-tidy fixes. NFC 2021-01-29 01:01:19 +01:00
SuspiciousMissingCommaCheck.h
SuspiciousSemicolonCheck.cpp clang-{tools,unittests}: Stop using SourceManager::getBuffer, NFC 2020-10-15 00:35:16 -04:00
SuspiciousSemicolonCheck.h
SuspiciousStringCompareCheck.cpp [clang-tidy] Fix lint warnings in clang-tidy source code (NFC) 2021-11-02 20:14:25 +13:00
SuspiciousStringCompareCheck.h
SwappedArgumentsCheck.cpp
SwappedArgumentsCheck.h
TerminatingContinueCheck.cpp [clang-tidy] Fix bugprone-terminating-continue when continue appears inside a switch 2021-03-20 10:59:37 +00:00
TerminatingContinueCheck.h
ThrowKeywordMissingCheck.cpp [clang-tidy][#51939] Exempt placement-new expressions from 'bugprone-throw-keyword-missing' 2021-12-15 16:59:14 +01:00
ThrowKeywordMissingCheck.h [clang-tidy] Simplify throw keyword missing check 2021-02-20 22:07:20 +00:00
TooSmallLoopVariableCheck.cpp Remove references to the ast_type_traits namespace 2020-12-11 00:58:46 +01:00
TooSmallLoopVariableCheck.h
UndefinedMemoryManipulationCheck.cpp
UndefinedMemoryManipulationCheck.h
UndelegatedConstructorCheck.cpp Remove references to the ast_type_traits namespace 2020-12-11 00:58:46 +01:00
UndelegatedConstructorCheck.h [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
UnhandledExceptionAtNewCheck.cpp [clang-tidy] Add new check 'bugprone-unhandled-exception-at-new'. 2021-04-14 09:33:11 +02:00
UnhandledExceptionAtNewCheck.h [clang-tidy] Add new check 'bugprone-unhandled-exception-at-new'. 2021-04-14 09:33:11 +02:00
UnhandledSelfAssignmentCheck.cpp [clang-tidy] Use new mapping matchers 2021-02-03 23:21:17 +00:00
UnhandledSelfAssignmentCheck.h [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
UnusedRaiiCheck.cpp [clang-tidy] Use `hasCanonicalType()` matcher in `bugprone-unused-raii` check 2021-12-02 01:53:12 +01:00
UnusedRaiiCheck.h [clang-tidy] Simplify unused RAII check 2021-03-02 21:33:34 +00:00
UnusedReturnValueCheck.cpp [clang-tidy] Expand the list of functions in bugprone-unused-return-value 2020-05-22 12:57:58 -04:00
UnusedReturnValueCheck.h
UseAfterMoveCheck.cpp [clang-tidy] Fix `bugprone-use-after-move` check to also consider moves in constructor initializers 2021-11-15 07:41:35 +00:00
UseAfterMoveCheck.h [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
VirtualNearMissCheck.cpp Revert "[clang-itdy] Simplify virtual near-miss check" 2021-02-27 19:30:38 +00:00
VirtualNearMissCheck.h Revert "[clang-itdy] Simplify virtual near-miss check" 2021-02-27 19:30:38 +00:00