This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/37860] default and delete used w/ member functions vs. initialization
- From: "bkoz at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Oct 2008 08:19:26 -0000
- Subject: [Bug c++/37860] default and delete used w/ member functions vs. initialization
- References: <bug-37860-365@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from bkoz at gcc dot gnu dot org 2008-10-17 08:19 -------
Sorry, that should have a single argument ctor.
Like:
struct b
{
bool t;
b() = default;
~b() = default;
b& operator=(const b&) = delete;
b(const b&) = delete;
b(bool) { }
};
Gives:
%g++ -std=c++0x -c atomic_init_forms.cc
atomic_init_forms.cc: In function 'int main()':
atomic_init_forms.cc:8: error: deleted function 'b::b(const b&)'
atomic_init_forms.cc:16: error: used here
atomic_init_forms.cc:8: error: deleted function 'b::b(const b&)'
atomic_init_forms.cc:19: error: used here
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37860