Skip to content

Fix #14546 FN uninitMemberVar (in-class initializers but no constructor)#8274

Open
chrchr-github wants to merge 13 commits intocppcheck-opensource:mainfrom
chrchr-github:chr_14546
Open

Fix #14546 FN uninitMemberVar (in-class initializers but no constructor)#8274
chrchr-github wants to merge 13 commits intocppcheck-opensource:mainfrom
chrchr-github:chr_14546

Conversation

@chrchr-github
Copy link
Copy Markdown
Collaborator

No description provided.

@sonarqubecloud
Copy link
Copy Markdown

Comment thread lib/checkclass.cpp Outdated
Comment thread test/testconstructors.cpp Outdated
chrchr-github and others added 3 commits April 10, 2026 08:30
Co-authored-by: Daniel Marjamäki <daniel.marjamaki@gmail.com>
Comment thread lib/tokenize.h
@danmar
Copy link
Copy Markdown
Collaborator

danmar commented Apr 10, 2026

The idea of uninitMemberVar was to warn if a constructor fails to initialize members.

I have the feeling that this is doing something a bit different. A separate warning message and id could be a good idea that more specifically say that some members are initialized and others are not in a no-constructor struct.

and maybe uninitMemberVar should be specified better also so it's specified clearly that it checks constructors.

@sonarqubecloud
Copy link
Copy Markdown

danmar
danmar previously approved these changes Apr 25, 2026
Copy link
Copy Markdown
Collaborator

@danmar danmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

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

Successfully merging this pull request may close these issues.

3 participants