Skip to content

LWG-3417: Deprecate volatile atomic inc/dec and wait/notify operations - #6408

Open
Shengxin Pei (TPPPP72) wants to merge 2 commits into
microsoft:mainfrom
TPPPP72:main
Open

LWG-3417: Deprecate volatile atomic inc/dec and wait/notify operations#6408
Shengxin Pei (TPPPP72) wants to merge 2 commits into
microsoft:mainfrom
TPPPP72:main

Conversation

@TPPPP72

Copy link
Copy Markdown
Contributor

Resolves LWG 3417 (Missing volatile atomic deprecations) adding deprecation checks to volatile atomic increment/decrement operators as well as wait/notify operations when is_always_lock_free is false.

Close #6312

@TPPPP72
Shengxin Pei (TPPPP72) requested a review from a team as a code owner August 20, 2026 09:49
Copilot AI balanced review requested due to automatic review settings August 20, 2026 09:49
@github-project-automation github-project-automation Bot moved this to Initial Review in STL Code Reviews Aug 20, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

@TPPPP72 Shengxin Pei (TPPPP72) changed the title Fix LWG 3417: Deprecate volatile atomic inc/dec and wait/notify operations LWG 3417: Deprecate volatile atomic inc/dec and wait/notify operations Aug 20, 2026
@TPPPP72

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Implements LWG 3417 by completing conditional deprecation checks for volatile atomic operations.

Changes:

  • Adds checks for volatile increment/decrement and wait/notify operations.
  • Adds and registers coverage across supported language modes.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
stl/inc/atomic Adds conditional deprecation checks.
tests/std/tests/P1831R1_deprecated_volatile_atomic/test.cpp Exercises affected operations.
tests/std/tests/P1831R1_deprecated_volatile_atomic/env.lst Configures the test matrix.
tests/std/test.lst Registers the test.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread stl/inc/atomic Outdated
@@ -0,0 +1,50 @@
// Copyright (c) Microsoft Corporation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I strongly doubt whether this test file makes any sense. At least, it certainly isn't verifying deprecation at this moment.

IIUC, MSVC STL hasn't been verifying deprecation messages in its test suite.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It tests deprecation silencing, i.e. that these functions can be made back available as for now.

Comment thread tests/std/tests/P1831R1_deprecated_volatile_atomic/test.cpp Outdated
Copilot AI review requested due to automatic review settings August 20, 2026 16:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (1)

tests/std/tests/P1831R1_deprecated_volatile_atomic/test.cpp:31

  • These calls only use atomic<int> (and below, atomic<int*>), both of which are always lock-free in this implementation. Therefore _Deprecate_non_lock_free_volatile<_Ty, false> is never selected, so the test does not exercise the newly added wait/notify deprecation path or its suppression. Please also instantiate these operations with a guaranteed non-lock-free trivially copyable type.
    volatile atomic<int> ai{0};
    ai.notify_one();
    ai.notify_all();
    ai.wait(1);

@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) changed the title LWG 3417: Deprecate volatile atomic inc/dec and wait/notify operations LWG-3417: Deprecate volatile atomic inc/dec and wait/notify operations Aug 24, 2026
@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) added the LWG Library Working Group issue label Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LWG Library Working Group issue

Projects

Status: Initial Review

Development

Successfully merging this pull request may close these issues.

LWG-3417 Missing volatile atomic deprecations

5 participants