Skip to content

Add [[maybe_unused]] to all inline variables#70

Merged
saki7 merged 1 commit intoboostorg:developfrom
saki7:add-maybe-unused-to-cpo
Oct 7, 2025
Merged

Add [[maybe_unused]] to all inline variables#70
saki7 merged 1 commit intoboostorg:developfrom
saki7:add-maybe-unused-to-cpo

Conversation

@saki7
Copy link
Collaborator

@saki7 saki7 commented Oct 7, 2025

Part of #1
Follow-up for #68 and potentially many other PRs

Many inline variables, notably inline constexpr CPOs were introduced since the beginning of the C++23 modernization. GCC tends to report false-positive "unused variable" warnings for such entities. It has been problematic because the warnings were shown in a very unpredictable scenario; even I made sure no warnings were shown in the initial PR, the warnings were showing up after some irrelevant PRs were merged.

This PR proactively adds [[maybe_unused]] to all inline variables to prevent further bogus warnings.

@saki7 saki7 self-assigned this Oct 7, 2025
@saki7 saki7 added the upstream-workaround Temporary workaround for upstream defects. This must be reviewed and reverted later, if possible label Oct 7, 2025
@saki7 saki7 mentioned this pull request Oct 7, 2025
@saki7 saki7 merged commit 7c77660 into boostorg:develop Oct 7, 2025
13 checks passed
@saki7 saki7 deleted the add-maybe-unused-to-cpo branch October 7, 2025 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

upstream-workaround Temporary workaround for upstream defects. This must be reviewed and reverted later, if possible

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant