https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85886

            Bug ID: 85886
           Summary: std::atomic<> doesn't have value_type and
                    difference_type
           Product: gcc
           Version: 8.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: freddie_chopin at op dot pl
  Target Milestone: ---

According to https://en.cppreference.com/w/cpp/atomic/atomic std::atomic<>
should contain value_type and difference_type, which is not the case in GCC's
libstdc++.

Use case:

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

#include <atomic>
#include <cassert>
#include <limits>

void f()
{
    std::atomic_int8_t referenceCount_;
    assert(referenceCount_ !=
std::numeric_limits<std::decay<decltype(referenceCount_)>::type::value_type>::max());
    ++referenceCount_;
}

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

Reply via email to