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 c++/37860] default and delete used w/ member functions vs. initialization



------- 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


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