c++ - clang 3.2 fails on std::atomic -- a libc++ issue? -


i try compile simple code

#include <atomic> int bar = 0; void foo(std::atomic<int>&flag) { bar = flag; } 

with clang++ 3.2 (downloaded llvm 3.2 llvm.org; on mac os.x 10.8.3 fails error

/> clang++ -std=c++11 -stdlib=libc++ -o3 -march=native -c test.cc

in file included test.cc:1:

/usr/include/c++/v1/atomic:576:17: error: first argument atomic operation must pointer non-const _atomic type ('const _atomic(int) *' invalid)

{return __c11_atomic_load(&__a_, __m);}         ^                 ~~~~~ 

/usr/include/c++/v1/atomic:580:53: note: in instantiation of member function 'std::_1::_atomic_base::load' requested here

operator _tp() const _noexcept          {return load();}                                                 ^ 

test.cc:5:9: note: in instantiation of member function 'std::_1::_atomic_base::operator int' requested here

bar = done; 

when use /usr/bin/clang++ instead (which comes os or xcode) compiles fine. libc++ @ /usr/lib/c++/v1 in both cases.

what missing? there libc++ comes llvm 3.2 i'm missing? (i cannot find in clang3.2 tree).

xcode bundles libc++ within xcode.app directory. can inspect directory control-clicking xcode.app , choose "show package contents".


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -