mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-27 17:49:37 +01:00
Merge bitcoin/bitcoin#34523: doc: Clarify why performance-move-const-arg.CheckTriviallyCopyableMove=false
fa88ac3f4fdoc: Clarify why performance-move-const-arg.CheckTriviallyCopyableMove=false (MarcoFalke) Pull request description: Without this doc, there is a risk that the setting will be turned off, see https://github.com/bitcoin/bitcoin/pull/34514. The reason to disable it is to catch logic bugs, even on trivially copyable types: ```cpp #include <utility> void Eat(int&& food) { food = 0; }; int main() { int food{2}; Eat(std::move(food)); Eat(std::move(food)); // This should err } ``` ACKs for top commit: l0rinc: ACKfa88ac3f4fhebasto: ACKfa88ac3f4f. sedited: ACKfa88ac3f4fTree-SHA512: d1bda846a10190a2936084a06bd87418c6a3e4ababc298e4beb9bc9e1190bff430cbe973475d634eda5ef7863571c89bfa4b78ff63fcbd9ac10c42fd9d5fa23a
This commit is contained in:
@@ -37,7 +37,7 @@ CheckOptions:
|
||||
- key: modernize-deprecated-headers.CheckHeaderFile
|
||||
value: false
|
||||
- key: performance-move-const-arg.CheckTriviallyCopyableMove
|
||||
value: false
|
||||
value: false # Disabled, to allow the bugprone-use-after-move rule on trivially copyable types, to catch logic bugs
|
||||
- key: bugprone-unhandled-self-assignment.WarnOnlyIfThisHasSuspiciousField
|
||||
value: false
|
||||
- key: bugprone-unused-return-value.CheckedReturnTypes
|
||||
|
||||
Reference in New Issue
Block a user