Page MenuHomePhabricator

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

Authored by Fabien on Feb 11 2021, 16:07.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABCcb797685a0be: [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) {}.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
linter_cpp_void_bracket
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 15184
Build 30314: Build Diff
Build 30313: arc lint + arc unit