Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M0-1-2 - A3-1-5 - A4-5-1 - M0-1-1 : Poor lambda support #605

Open
nbusser opened this issue Jun 2, 2024 · 1 comment
Open

M0-1-2 - A3-1-5 - A4-5-1 - M0-1-1 : Poor lambda support #605

nbusser opened this issue Jun 2, 2024 · 1 comment
Labels
Difficulty-Low A false positive or false negative report which is expected to take <1 day effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Medium Standard-AUTOSAR user-report Issue reported by an end user of CodeQL Coding Standards

Comments

@nbusser
Copy link

nbusser commented Jun 2, 2024

Affected rules

  • M0-1-2
  • A3-1-5
  • A4-5-1
  • M0-1-1

Description

Using lambda expression trigger various side effects alerts.

Example

A3-1-5

const auto lambda = []() -> void {} // Trigger A3-1-5

A4-5-1

enum Enum { A, B };

const auto lambda = [](const Enum e) -> void {}

const auto e = Enum::A;
lambda(e); // Triggers A4-5-1

M0-1-1 / M0-1-2

std::uint32_t u32{0};

const auto lambda = [&u32]() -> void {
  ++u32;
}

lambda();

if (u32 == 0) { // Triggers M0-1-2
  return;
}

foo(); // (could be any expression) Triggers M0-1-1
@nbusser nbusser added the false positive/false negative An issue related to observed false positives or false negatives. label Jun 2, 2024
@nbusser nbusser changed the title M0-1-2 - A3-1-5 - A4-5-1 M0-1-1 - : Poor lambda support M0-1-2 - A3-1-5 - A4-5-1 M0-1-1 : Poor lambda support Jun 3, 2024
@nbusser nbusser changed the title M0-1-2 - A3-1-5 - A4-5-1 M0-1-1 : Poor lambda support M0-1-2 - A3-1-5 - A4-5-1 - M0-1-1 : Poor lambda support Jun 3, 2024
@lcartey
Copy link
Collaborator

lcartey commented Jun 3, 2024

Thanks for the report!

For A3-1-5 I anticipate this PR will fix the problem:
#610

@lcartey lcartey added the user-report Issue reported by an end user of CodeQL Coding Standards label Oct 15, 2024
@lcartey lcartey added Difficulty-Low A false positive or false negative report which is expected to take <1 day effort to address Impact-Medium labels Oct 23, 2024
@lcartey lcartey moved this from Reported to Triaged in Coding Standards Public Development Board Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty-Low A false positive or false negative report which is expected to take <1 day effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Medium Standard-AUTOSAR user-report Issue reported by an end user of CodeQL Coding Standards
Projects
Development

No branches or pull requests

3 participants