Skip to content

fix #14795: FP unusedStructMember when type is a template parameter#8600

Open
ludviggunne wants to merge 2 commits into
cppcheck-opensource:mainfrom
ludviggunne:14795
Open

fix #14795: FP unusedStructMember when type is a template parameter#8600
ludviggunne wants to merge 2 commits into
cppcheck-opensource:mainfrom
ludviggunne:14795

Conversation

@ludviggunne

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread test/testunusedvar.cpp
@chrchr-github

Copy link
Copy Markdown
Collaborator

I wonder why the TODO in boost.cpp is not resolved.

@ludviggunne

ludviggunne commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator Author

I wonder why the TODO in boost.cpp is not resolved.

This one?

struct is_dataset<fibonacci_dataset> : boost::mpl::true_ {};

It's a different case for specializations because the tokens are pasted together: "is_dataset < fibonacci_dataset >". I'll add a new ticket.

@chrchr-github

Copy link
Copy Markdown
Collaborator

I wonder why the TODO in boost.cpp is not resolved.

This one?

struct is_dataset<fibonacci_dataset> : boost::mpl::true_ {};

It's a different case for specializations because the tokens are pasted together: "is_dataset < fibonacci_dataset >". I'll add a new ticket.

I actually misread that code, the template specialization cannot use the struct member. The type (or an object thereof) is used in the BOOST_DATA_TEST_CASE macro though, so unusedStructMember should bail out on that.

Comment thread lib/checkunusedvar.cpp Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants