C++ PATCH for c++/51553 (list-initialization using conversion op)
Jason Merrill
jason@redhat.com
Mon Dec 19 20:21:00 GMT 2011
The code I put in back when I implemented list-initialization rejects
additional user-defined conversions when considering the copy parm of a
copy/move constructor, in order to avoid ambiguity when a nested
braced-init-list could initialize either the copy parm or the parm of
another constructor. But this testcase shows that this is too broad; we
only want to suppress the copy constructor when the argument is another
braced-init-list.
That change fixes most of the testcase, but then we incorrectly accept
the declaration of 'c'. To fix that, we need to separate the handling
of explicit constructors from explicit conversion operators in
list-initialization.
Tested x86_64-pc-linux-gnu, applying to trunk.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 51553.patch
Type: text/x-patch
Size: 1506 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20111219/f2aaaa9d/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 51553-2.patch
Type: text/x-patch
Size: 4385 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20111219/f2aaaa9d/attachment-0001.bin>
More information about the Gcc-patches
mailing list