Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 09 May 2021 03:13:08 +0000
From:      bugzilla-noreply@freebsd.org
To:        standards@FreeBSD.org
Subject:   [Bug 255720] std::memory_order::memory_order_seq_cst doesn't exist in c++2a when the standard says that it should exist
Message-ID:  <bug-255720-99@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D255720

            Bug ID: 255720
           Summary: std::memory_order::memory_order_seq_cst doesn't exist
                    in c++2a when the standard says that it should exist
           Product: Base System
           Version: 12.2-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: standards
          Assignee: standards@FreeBSD.org
          Reporter: yuri@freebsd.org

This code:

> #include <atomic>
>=20
> void f() {
>         std::atomic<unsigned int> n;
>         n.fetch_add(std::memory_order::memory_order_seq_cst);
> }

fails with -std=3Dc++2a:
> x.cpp:10:33: error: no member named 'memory_order_seq_cst' in 'std::__1::=
memory_order'
>         n.fetch_add(std::memory_order::memory_order_seq_cst);
>                     ~~~~~~~~~~~~~~~~~~~^

but succeeds with -std=3Dc++17.

The standard doesn't say that this symbol is obsoleted in c++20:
https://en.cppreference.com/w/cpp/atomic/memory_order

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-255720-99>