Skip to content

M0-1-4: Recognise aggregate literal initializers #388

Closed
@lcartey

Description

@lcartey

Affected rules

  • M0-1-4

Description

M0-1-4 identifies single use variables, but for member variables we do not recognise the initialization of variables in an aggregate initializer as a use.

In addition, we should search for other places where we count uses of member variables to ensure this case is also captured there.

Example

struct agg {
  int x;
};

void test_agg() {
  agg a = {1};
  a.x;
}

Metadata

Metadata

Assignees

Labels

Difficulty-LowA false positive or false negative report which is expected to take <1 day effort to addressImpact-Mediumfalse positive/false negativeAn issue related to observed false positives or false negatives.user-reportIssue reported by an end user of CodeQL Coding Standards

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions