Skip to content

Implement -Wunused-record-wildcards and -Wredundant-record-wildcards

Matthew Pickering requested to merge wip/wildcards-warn into master

See #15957 (closed)

This patch implements two new flags: -Wunused-record-wildcards which warns when none of the variables bound by a record wildcard .. pattern are used and -Wredundant-record-wildcards which warns when a record wildcard .. pattern binds no variables at all. These checks are implemented by the function checkUnusedRecordWildcard.

The interaction between the two flags is also considered, we shouldn't warn twice in the case where no variables are bound so we check first for -Wredundant-record-wildcards and then for -Wunused-record-wildcards.

Edited by Matthew Pickering

Merge request reports