[Bug c++/60258] Member initialization for atomic fail.
daniel.kruegler at googlemail dot com
gcc-bugzilla@gcc.gnu.org
Tue Feb 18 20:06:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60258
Daniel Krügler <daniel.kruegler at googlemail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |daniel.kruegler@googlemail.
| |com
--- Comment #4 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
Reduced example:
//------------------
#include <atomic>
template <class>
struct base
{
std::atomic_bool magic{false};
};
int main()
{
base<void> b;
}
//------------------
Diagnostics (gcc HEAD 4.9.0 20140215 (experimental)):
<quote>
prog.cc: In constructor 'constexpr base<void>::base()':
prog.cc:4:8: error: use of deleted function
'std::atomic_bool::atomic_bool(const std::atomic_bool&)'
struct base
^
In file included from prog.cc:1:0:
/usr/local/gcc-head/include/c++/4.9.0/atomic:62:5: note: declared here
atomic_bool(const atomic_bool&) = delete;
^
prog.cc: In function 'int main()':
prog.cc:11:14: note: synthesized method 'constexpr base<void>::base()' first
required here
base<void> b;
^
</quote>
The error doesn't occur, if the class template is replaced by a non-template
class.
More information about the Gcc-bugs
mailing list