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

Initialization of data attribute with braces is mistakenly considered as a method #2027

Closed
srpgilles opened this issue Jan 7, 2021 · 3 comments · Fixed by #2030
Closed
Assignees
Labels
Milestone

Comments

@srpgilles
Copy link

srpgilles commented Jan 7, 2021

If a data attribute is initialized with braces:

struct Foo
{
    int bar_ {};
};

you may end up with a (major by default) code smell that tells the naming convention for methods is not respected.

The obvious workaround is to use different way to set the default value (int bar_ = 0 for instance) but some coding standards actually recommend using the braces

@guwirth guwirth added the bug label Jan 7, 2021
@guwirth
Copy link
Collaborator

guwirth commented Jan 8, 2021

@srpgilles fixed in 2.0

@srpgilles
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants