[v3 PATCH] LWG 2510, make the default constructors of library tag types explicit.

Jonathan Wakely jwakely@redhat.com
Wed Nov 11 17:30:00 GMT 2015


On 11/11/15 18:17 +0100, Dominique d'Humières wrote:
>Revision r230175
>
>> 2015-11-10  Ville Voutilainen  <ville.voutilainen@gmail.com>
>>
>>     LWG 2510, make the default constructors of library tag types
>>     explicit.
>>     * include/bits/mutex.h (defer_lock_t, try_lock_t,
>>     adopt_lock_t): Add an explicit default constructor.
>>     * include/bits/stl_pair.h (piecewise_construct_t): Likewise.
>>     * include/bits/uses_allocator.h (allocator_arg_t): Likewise.
>>     * libsupc++/new (nothrow_t): Likewise.
>>     * testsuite/17_intro/tag_type_explicit_ctor.cc: New.
>
> breaks bootstrap
>
>libtool: compile:  /opt/gcc/build_w/./gcc/xgcc -shared-libgcc -B/opt/gcc/build_w/./gcc -nostdinc++ -L/opt/gcc/build_w/x86_64-apple-darwin14.5.0/libstdc++-v3/src -L/opt/gcc/build_w/x86_64-apple-darwin14.5.0/libstdc++-v3/src/.libs -L/opt/gcc/build_w/x86_64-apple-darwin14.5.0/libstdc++-v3/libsupc++/.libs -B/opt/gcc/gcc6w/x86_64-apple-darwin14.5.0/bin/ -B/opt/gcc/gcc6w/x86_64-apple-darwin14.5.0/lib/ -isystem /opt/gcc/gcc6w/x86_64-apple-darwin14.5.0/include -isystem /opt/gcc/gcc6w/x86_64-apple-darwin14.5.0/sys-include -I/opt/gcc/work/libstdc++-v3/../libgcc -I/opt/gcc/build_w/x86_64-apple-darwin14.5.0/libstdc++-v3/include/x86_64-apple-darwin14.5.0 -I/opt/gcc/build_w/x86_64-apple-darwin14.5.0/libstdc++-v3/include -I/opt/gcc/work/libstdc++-v3/libsupc++ -D_GLIBCXX_SHARED -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi -fdiagnostics-show-location=once -fvisibility-inlines-hidden -ffunction-sections -fdata-sections -frandom-seed=new_handler.lo -g -O2 -std=gnu++11 -c ../../../../work/libstdc++-v3/libsupc++/new_handler.cc  -fno-common -DPIC -D_GLIBCXX_SHARED -o new_handler.o
>../../../../work/libstdc++-v3/libsupc++/new_handler.cc:37:39: error: converting to 'std::nothrow_t' from initializer list would use explicit constructor 'constexpr std::nothrow_t::nothrow_t()'
> const std::nothrow_t std::nothrow = { };
>                                       ^
>see https://gcc.gnu.org/ml/gcc-regression/2015-11/

Fixed by this patch.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 590 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20151111/25688724/attachment.bin>


More information about the Gcc-patches mailing list