C++ PATCH for c++/35782, 37860

Jason Merrill jason@redhat.com
Tue Dec 2 23:52:00 GMT 2008

The C++0x atomics library wants to disable copying of atomics, but still 
support aggregate initialization.  Some folks on the committee thought 
that the new initializer list extension would make this work; I thought 
that it wouldn't, as

struct A
   A(const A&) = delete;

A a = { 1 };

would involve a call to the deleted copy constructor, which is 
ill-formed.  But when I read over the actual standardese, there's no 
copy constructor call involved.  Which isn't what I had in mind when I 
wrote up the proposal, but it seems to be what users want.  So I've 
fixed the compiler accordingly.

Tested x86_64-pc-linux-gnu, applied to trunk.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 35782.patch
Type: text/x-patch
Size: 4297 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20081202/016c3c19/attachment.bin>

More information about the Gcc-patches mailing list