atomic header cannot be compiled into translation unit with -fkeep-inline-functions
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc |
Fix Released
|
Medium
|
|||
gcc-6 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
With gcc-6 6.1.1-11ubuntu11:
$ echo '#include <atomic>' > foo.h
$ gcc -fdump-
In file included from /usr/include/
/usr/include/
/usr/include/
^~~~
In file included from foo.h:1:0:
/usr/include/
{ return _M_base.load(); }
Expected no errors, and translation unit dumped as before, as was with gcc 5.4.0-6ubuntu1:
$ gcc -std=c++11 -fdump-
Changed in gcc: | |
importance: | Unknown → Medium |
status: | Unknown → Confirmed |
Changed in gcc: | |
status: | Confirmed → Fix Released |
$ echo '#include <atomic>' > foo.h
$ gcc-6 -std=c++11 -fdump- translation- unit -fkeep- inline- functions -c -x c++-header -fpermissive -w -fPIC foo.h c++/6/atomic: 41:0,
from foo.h:1: c++/6/bits/ atomic_ base.h: In member function 'std::atomic< bool>:: operator bool() const': c++/6/bits/ atomic_ base.h: 390:7: error: inlining failed in call to always_inline 'std::_ _atomic_ base<_IntTp> ::__int_ type std::__ atomic_ base<_IntTp> ::load( std::memory_ order) const noexcept [with _ITp = bool; std::__ atomic_ base<_IntTp> ::__int_ type = bool; std::memory_order = std::memory_ order]' : function body not available
load(memory_ order __m = memory_ order_seq_ cst) const noexcept c++/6/atomic: 81:27: note: called from here
^
In file included from /usr/include/
/usr/include/
/usr/include/
^~~~
In file included from foo.h:1:0:
/usr/include/
{ return _M_base.load(); }
$ gcc-5 -std=c++11 -fdump- translation- unit -fkeep- inline- functions -c -x c++-header -fpermissive -w -fPIC foo.h