This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/64658] New: std::atomic_init() undefined


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]