[Bug c++/60258] Member initialization for atomic fail.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60258 Paolo Carlini paolo.carlini at oracle dot com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |DUPLICATE --- Comment #6 from Paolo Carlini paolo.carlini at oracle dot com --- Dup, already fixed. *** This bug has been marked as a duplicate of bug 58930 ***
[Bug c++/60258] Member initialization for atomic fail.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60258 Jonathan Wakely redi at gcc dot gnu.org changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2014-02-19 Ever confirmed|0 |1
[Bug c++/60258] Member initialization for atomic fail.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60258 Jakub Jelinek jakub at gcc dot gnu.org changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #1 from Jakub Jelinek jakub at gcc dot gnu.org --- Why the auto my_func() - void rather than void my_func() ? The fact that C++11 allows the former form doesn't mean the latter form is deprecated, and in the case when the return type doesn't depend on argument types it doesn't make any sense to use that form.
[Bug c++/60258] Member initialization for atomic fail.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60258 --- Comment #2 from ja.gcc.bugzilla at aptsketch dot com --- auto foo() - void vs void foo() is more of just a stylistic issue. There is nothing wrong with both. To me both are good. The bug is about std::atomic member initialization. Where if there is member initialization std::atomic_size_t x{10} the compiler chokes on it.
[Bug c++/60258] Member initialization for atomic fail.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60258 --- Comment #3 from Jakub Jelinek jakub at gcc dot gnu.org --- Sure, my comment was about this stylistic issue, not about the real bug (if any, haven't tried it). Note your testcase isn't self-contained, you probably need #include atomic.
[Bug c++/60258] Member initialization for atomic fail.
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() { basevoid b; } //-- Diagnostics (gcc HEAD 4.9.0 20140215 (experimental)): quote prog.cc: In constructor 'constexpr basevoid::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 basevoid::base()' first required here basevoid b; ^ /quote The error doesn't occur, if the class template is replaced by a non-template class.
[Bug c++/60258] Member initialization for atomic fail.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60258 --- Comment #5 from Daniel Krügler daniel.kruegler at googlemail dot com --- (In reply to Daniel Krügler from comment #4) Reduced example: More reduced by eliminating library dependencies: //-- struct atomic_bool { atomic_bool(const atomic_bool) = delete; constexpr atomic_bool(bool) noexcept { } }; #define USE_TEMPLATE #ifdef USE_TEMPLATE template class #endif struct base { atomic_bool magic{false}; }; int main() { #ifdef USE_TEMPLATE basevoid b; #else base b; #endif } //--