[cfe-dev] Using C++11 <atomic> with Clang SVN

Matthias Vallentin vallentin at icir.org
Thu Apr 19 11:29:07 PDT 2012


I am having trouble with <atomic> and Clang SVN (Mac OSX Lion). Here is
the test program:

    #include <atomic>

    int main()
    {
        std::atomic_size_t a(0ul);
        ++a;
        --a;

        return 0;
    }

This generates the following error:

    In file included from test.cc:1:
    /usr/include/c++/v1/atomic:1352:51: error: too few arguments to
function call, expected 4, have 3
            {return __atomic_exchange(&__a_, true, __m);}
                    ~~~~~~~~~~~~~~~~~                 ^
    /usr/include/c++/v1/atomic:1355:51: error: too few arguments to
function call, expected 4, have 3
            {return __atomic_exchange(&__a_, true, __m);}
                    ~~~~~~~~~~~~~~~~~                 ^

>From the C++11 status page [1], I see that atomic operations (N2427) are
already supported in the SVN repository, but strong compare and exchange
(N2748) not yet. Is the above error message occurring due to the lacking
support for N2748?

    Matthias

[1] http://clang.llvm.org/cxx_status.html



More information about the cfe-dev mailing list