Skip to content

Conversation

@dunhor
Copy link
Member

@dunhor dunhor commented Oct 2, 2024

Clang-tidy (and I'm pretty sure just Clang in general since this is a Clang diagnostic) warns that these variables are unused. This happens because the single threaded collections types use the following lock guard type:

struct nop_lock_guard {};

I could also fix this issue by adding a destructor to the type, however that may have consequences on code-gen. This seemed to be the less risky change with the tradeoff of touching more lines.

@sylveon
Copy link
Contributor

sylveon commented Oct 2, 2024

Would doing struct [[nodiscard]] nop_lock_guard {}; silence the warning as well?

@dunhor
Copy link
Member Author

dunhor commented Oct 2, 2024

Would doing struct [[nodiscard]] nop_lock_guard {}; silence the warning as well?

Looks like no: https://godbolt.org/z/YY9vEqh4s

@dunhor dunhor merged commit f9ec198 into master Oct 2, 2024
@dunhor dunhor deleted the dunhor/tidyfix branch October 2, 2024 22:15
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.

5 participants