Skip to content

Implement LWG 3268's PR to fix #150. - #151

Merged
Stephan T. Lavavej (StephanTLavavej) merged 1 commit into
microsoft:masterfrom
StephanTLavavej:atomic
Oct 1, 2019
Merged

Stephan T. Lavavej (StephanTLavavej) merged 1 commit into
microsoft:masterfrom
StephanTLavavej:atomic

Conversation

@StephanTLavavej

@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) commented Oct 1, 2019

Copy link
Copy Markdown
Member

This implements the Proposed Resolution for LWG-3268.

Fixes #150.

This is a back-compat fix for users who were saying things like
std::memory_order::memory_order_relaxed. As there is nothing
especially problematic about such usage, and LWG's ultimate resolution
is unknown, I'm not deprecating these enumerators at this time. If and
when this is voted into the WP in the deprecated clause, then we can
add deprecated attributes.

This mirrors a Microsoft-internal PR:
https://devdiv.visualstudio.com/DevDiv/_git/msvc/pullrequest/205250

Please note that acceptance of community PRs will be delayed while we are
bringing our test and CI systems online. For more information, see the
README.md.

Description

Checklist:

  • I understand README.md.
  • If this is a feature addition, that feature has been voted into the C++
    Working Draft. (LWG 3268's Proposed Resolution has NOT been voted into the Working Draft, but this change is necessary to avoid breaking real world code that conformed to C++11/14/17.)
  • Identifiers in any product code changes are properly _Ugly as per
    https://eel.is/c++draft/lex.name#3.1 .
  • Identifiers in test code changes are not _Ugly. (N/A, no tests here)
  • Test code includes the correct headers as per the Standard, not just
    what happens to compile. (N/A, no tests here)
  • The STL builds and test harnesses have passed (must be manually verified
    by an STL maintainer before CI is online, leave this unchecked for initial
    submission).
  • This change introduces no known ABI breaks (adding members, renaming
    members, adding virtual functions, changing whether a type is an aggregate or
    trivially copyable, etc.). If unsure, leave this box unchecked and ask a
    maintainer for help.

This is a back-compat fix for users who were saying things like
`std::memory_order::memory_order_relaxed`. As there is nothing
especially problematic about such usage, and LWG's ultimate resolution
is unknown, I'm not deprecating these enumerators at this time. If and
when this is voted into the WP in the deprecated clause, then we can
add deprecated attributes.

This mirrors a Microsoft-internal PR:
https://devdiv.visualstudio.com/DevDiv/_git/msvc/pullrequest/205250
@BillyONeal

Copy link
Copy Markdown
Member

Apparently you can approve harder!

@raidenluikang

Copy link
Copy Markdown

Hi, can I ask question there?

Why old style memory_order_meow inside enum class is not a deprecated?

For example:

enum class memory_order
{
    relaxed, 
    //...
    
    
    memory_order_relaxed [[deprecated]]  = relaxed,
   //...
}

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.

LWG-3268 memory_order::memory_order_meow broken in C++20

4 participants