Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LWG Poll 20: P1831R1 Deprecating volatile: library #3776

Merged
merged 3 commits into from Mar 3, 2020

Conversation

jensmaurer
Copy link
Member

Also fixes NB CZ 004, CA 210, and US 211 (C++20 CD).

  • atomic_init was already deprecated, with and without volatile

Fixes #3722 .
Fixes cplusplus/papers#589.
Fixes cplusplus/nbballot#4
Fixes cplusplus/nbballot#208.

@jensmaurer jensmaurer added this to the post-2020-02 milestone Feb 20, 2020
@jensmaurer jensmaurer changed the title P1831R1 Deprecating volatile: library LWG Poll 20: P1831R1 Deprecating volatile: library Feb 21, 2020
source/atomics.tex Outdated Show resolved Hide resolved
source/future.tex Outdated Show resolved Hide resolved
source/future.tex Outdated Show resolved Hide resolved
source/future.tex Outdated Show resolved Hide resolved
source/future.tex Outdated Show resolved Hide resolved
Comment on lines 1556 to 1579
Then each of the two templates shall satisfy
the \tcode{UnaryTypeTrait} requirements
with a base characteristic of \tcode{integral_constant<size_t, VS::value>}.
Copy link
Contributor

Choose a reason for hiding this comment

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

Bad wording

Copy link
Member Author

Choose a reason for hiding this comment

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

see above

source/future.tex Outdated Show resolved Hide resolved
T operator @\placeholdernc{op}@=(T operand) volatile noexcept;
T* fetch_@\placeholdernc{key}@(ptrdiff_t operand, memory_order order = memory_order::seq_cst) volatile noexcept;
\end{codeblock}

\rSec2[depr.atomics.nonmembers]{Non-member functions}

\indexlibraryglobal{atomic_init}%
Copy link
Contributor

Choose a reason for hiding this comment

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

The second part of this change to [depr.atomics] is missing:
"The following non-member function is available when atomic::is_always_lock_free is false:"

I realize atomic_init was already deprecated, so maybe change the wording to say "For the volatile overload of this function, ..."

Copy link
Member Author

Choose a reason for hiding this comment

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

Here's the problem: The entirety of atomic_init is deprecated and the "volatile" part is double-deprecated. So the "If" reduces to "If true".

Copy link
Contributor

@burblebee burblebee left a comment

Choose a reason for hiding this comment

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

In addition to the inline comments,fetch_key and operator op= are missing constraints clauses in [atomics.types.pointer]. Same for atomic_init in [depr.atomics.nonmembers] (was [atomics.nonmembers])

@jensmaurer
Copy link
Member Author

jensmaurer commented Feb 24, 2020

Regarding atomic_init, I think this is correct, because it's now all in [depr.atomics] where this paper also says "The following non-member function is available when atomic<T>::is_always_lock_free is false:" So, this seems to fold away to "if true" or "constraint: true".

atomics.types.pointer is fixed (but the resulting wording is wrong, because T is the pointee).

@jensmaurer
Copy link
Member Author

@zygoloid, [atomics.types.pointer] says now "Constraints: For the volatile overload of this function,
atomic<T>::is_always_lock_free is true." But this is in the partial specialization for "pointer to T", and we likely don't want to talk about T (the pointee) here, but about "pointer to T".
Fixing this doesn't look editorial to me, but maybe you can squint the right way.

source/future.tex Outdated Show resolved Hide resolved
@zygoloid zygoloid force-pushed the motions-2020-02-lwg-20 branch 2 times, most recently from 7b1263e to 2604894 Compare March 3, 2020 20:31
jensmaurer and others added 3 commits March 3, 2020 13:18
Also fixes NB CZ 004, CA 210, and US 211 (C++20 CD).

[depr.atomics.nonmembers] atomic_init was already deprecated, with and
without volatile, so the Constraints: clause would haver no effect and
was not added.

[depr.tuple] Fix broken introductory sentence.
[depr.variant] Fix missing introductory sentences.

[depr.atomics.volatile] Clarify that "is available" is overriding the
"Constraints:" clause.

[depr.tuple] Rebase paper on recent changes:
  * tuple_size and tuple_element specializations are also available in
    the <span> header
  * replace "shall meet" / "shall satisfy" with "meets"
@zygoloid zygoloid merged commit 90f9de1 into master Mar 3, 2020
@jensmaurer jensmaurer deleted the motions-2020-02-lwg-20 branch February 12, 2021 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants