Fix #14546 FN uninitMemberVar (in-class initializers but no constructor)#8274
Fix #14546 FN uninitMemberVar (in-class initializers but no constructor)#8274chrchr-github wants to merge 12 commits intodanmar:mainfrom
Conversation
|
Co-authored-by: Daniel Marjamäki <daniel.marjamaki@gmail.com>
| std::string filename; | ||
| int lineNumber; | ||
| int column; | ||
| int lineNumber{}; |
There was a problem hiding this comment.
hmm.. this struct is only accessible in Tokenizer methods and if I look manually I can quite easily see that lineNumber is always initialized when this struct is created.
A user can see this as noise. We could be less pedantic here.
If you feel this is wanted even though we can see the code is safe, well I wonder if a tweaked ID can be used for this more noisy warning.
|
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. |
|



No description provided.