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

A7-1-3: Triggered on static_cast #601

Open
nbusser opened this issue Jun 1, 2024 · 0 comments
Open

A7-1-3: Triggered on static_cast #601

nbusser opened this issue Jun 1, 2024 · 0 comments
Labels
false positive/false negative An issue related to observed false positives or false negatives.

Comments

@nbusser
Copy link

nbusser commented Jun 1, 2024

Affected rules

  • A7-1-3

Description

For some reason, A7-1-3 is triggered on basic varibales created from static_cast

Example

void false_positive() {
    std::uint8_t u8{0};

    auto const u32 = static_cast<std::uint32_t>(u8); // Triggers A7-1-3 warning
    std::uint32_t const u32b = static_cast<std::uint32_t>(u8); // Triggers A7-1-3 warning

    const auto u32c = static_cast<std::uint32_t>(u8); // Triggers A7-1-3 warning
    const std::uint32_t u32d = static_cast<std::uint32_t>(u8); // Triggers A7-1-3 warning
}
@nbusser nbusser added the false positive/false negative An issue related to observed false positives or false negatives. label Jun 1, 2024
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

1 participant