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

            Bug ID: 64658
           Summary: std::atomic_init() undefined
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org

#include <atomic>

int main()
{
  std::atomic_int a;
  atomic_init(&a, 0);
}

$ g++ -std=c++11 at.cc
In file included from at.cc:1:0:
/home/jwakely/gcc/5/include/c++/5.0.0/atomic:924:5: warning: inline function
‘void std::atomic_init(std::atomic<_ITp>*, _ITp) [with _ITp = int]’ used but
never defined
     atomic_init(atomic<_ITp>* __a, _ITp __i) noexcept;
     ^
/tmp/ccZgPnay.o: In function `main':
/tmp/at.cc:6: undefined reference to `void
std::atomic_init<int>(std::atomic<int>*, int)'
collect2: error: ld returned 1 exit status

Reply via email to