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

False warning: 'm_significand' can be constructed in initializer list #11

Open
olegoratovskiy opened this issue May 21, 2022 · 0 comments

Comments

@olegoratovskiy
Copy link

olegoratovskiy commented May 21, 2022

Description

Analyzer suggests constructing m_significand in the initializer list

Example

// int64_t m_significand & int64_t m_exponent are private fields of struct Exponential

Exponential::Exponential(int64_t number)
    : m_significand(number)
    , m_exponent(0)
{
    while (m_significand != 0 && m_significand % 10 == 0) {
        ++m_exponent;
        m_significand /= 10;
    }
}

Compile message

[  6%] Building CXX object CMakeFiles/expressions_lib.dir/src/exponential.cpp.o
error: 'm_significand' can be constructed in initializer list
m_significand /= 10;
        ^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant