Skip to content

RULE-10-0-1: Structured bindings should not be reported as violations #1172

Description

@MichaelRFairhurst

Affected rules

  • RULE-10-0-1
  • M8-0-1

Description

The examples for rule 10-0-1 specifically say that structured bindings are not a violation.

We can detect these with Variable.isStructuredBinding.

Example

void example_function(std::pair<int, long> p) {
  auto [i, l] = p; // COMPLIANT[False positive]
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions