HomePhabricator

[LINTER] Prevent updating `{ (void)foo() }` to `{ ()foo }`

Description

[LINTER] Prevent updating { (void)foo() } to { ()foo }

Summary:
The CppVoidParameterLinter can be unexpectedly confused by the use of
(void) to discard a function return value if it's not on it's own
line. This diff improves the regex to fix this edge case.

Test Plan:
Add { (void)foo() } to some source file and check the linter don't
trigger anymore. Check it still triggers as expected on foo(void) {}.

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D9214

Details

Provenance
FabienAuthored on Feb 11 2021, 16:05
FabienPushed on Feb 12 2021, 08:20
Reviewer
Restricted Project
Differential Revision
D9214: [LINTER] Prevent updating `{ (void)foo() }` to `{ ()foo }`
Parents
rABC95d0162dae28: Faster sigcache nonce
Branches
Unknown
Tags
Unknown