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

Initializing member variable in class declaration masks variable name error #69

Open
msmolens opened this issue May 18, 2017 · 2 comments

Comments

@msmolens
Copy link

With KWStyle.xml:

<?xml version="1.0" encoding="iso-8859-1"?>
<Description>
<InternalVariables>m_[A-Z],0,1</InternalVariables>
</Description>

and Test.h:

#ifndef Test_h
#define Test_h

class Test
{
public:
    Test() {}

private:
    float score = 0.0f;
};

#endif

KWStyle fails to show the error in the name of the member variable.

Without the initialization of the variable in the header the error is detected correctly:

$ KWStyle -xml KWStyle.xml -v Test.h -gcc
Test.h:0: error: Internal variable (score) doesn't match regular expression (m_[A-Z])

The error should still show even when the variable is initialized in the class declaration.

Tested with e03980f.

@wasim6691
Copy link

Variables inside the class should be m_[variable_Name] to represent it as the member variable. Close the issue please. Thanks

@aylward
Copy link
Collaborator

aylward commented Feb 24, 2020 via email

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

3 participants