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
false positive/false negative An issue related to observed false positives or false negatives.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
false positive/false negative An issue related to observed false positives or false negatives.
Projects
Development

No branches or pull requests

2 participants