On 5 Dec 2017, at 05:09, Marshall Clow via cfe-commits 
<cfe-commits@lists.llvm.org> wrote:
> 
> Author: marshall
> Date: Mon Dec  4 20:09:49 2017
> New Revision: 319736
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=319736&view=rev
> Log:
> Land D28253 which fixes PR28929 (which we mistakenly marked as fixed before)
...
> --- libcxx/trunk/include/memory (original)
> +++ libcxx/trunk/include/memory Mon Dec  4 20:09:49 2017
...
> @@ -4357,6 +4362,7 @@ template<class _A0, class _A1, class _A2
> shared_ptr<_Tp>
> shared_ptr<_Tp>::make_shared(_A0& __a0, _A1& __a1, _A2& __a2)
> {
> +    static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't 
> construct object in make_shared" );
>     typedef __shared_ptr_emplace<_Tp, allocator<_Tp> > _CntrlBlk;
>     typedef allocator<_CntrlBlk> _Alloc2;
>     typedef __allocator_destructor<_Alloc2> _D2;

This commit causes g++ to no longer be able to compile <memory> in pre-C++11 
mode, giving errors in the static assertions, like the following:

$ g++7 -nostdinc++ -isystem /share/dim/src/libcxx/trunk/include -std=c++03 -c 
test.cpp
In file included from /share/dim/src/libcxx/trunk/include/memory:648:0,
                 from test.cpp:1:
/share/dim/src/libcxx/trunk/include/memory: In static member function 'static 
std::__1::shared_ptr<_Tp> std::__1::shared_ptr<_Tp>::make_shared(_A0&, _A1&, 
_A2&)':
/share/dim/src/libcxx/trunk/include/memory:4365:5: error: wrong number of 
template arguments (4, should be at least 1)
     static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't 
construct object in make_shared" );
     ^
In file included from /share/dim/src/libcxx/trunk/include/memory:649:0,
                 from test.cpp:1:
/share/dim/src/libcxx/trunk/include/type_traits:3193:29: note: provided for 
'template<class _Tp, class _A0, class _A1> struct std::__1::is_constructible'
 struct _LIBCPP_TEMPLATE_VIS is_constructible
                             ^~~~~~~~~~~~~~~~
In file included from /share/dim/src/libcxx/trunk/include/memory:648:0,
                 from test.cpp:1:
/share/dim/src/libcxx/trunk/include/memory:4365:5: error: template argument 1 
is invalid
     static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't 
construct object in make_shared" );
     ^
/share/dim/src/libcxx/trunk/include/memory: In static member function 'static 
std::__1::shared_ptr<_Tp> std::__1::shared_ptr<_Tp>::allocate_shared(const 
_Alloc&, _A0&, _A1&, _A2&)':
/share/dim/src/libcxx/trunk/include/memory:4444:5: error: wrong number of 
template arguments (4, should be at least 1)
     static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't 
construct object in allocate_shared" );
     ^
In file included from /share/dim/src/libcxx/trunk/include/memory:649:0,
                 from test.cpp:1:
/share/dim/src/libcxx/trunk/include/type_traits:3193:29: note: provided for 
'template<class _Tp, class _A0, class _A1> struct std::__1::is_constructible'
 struct _LIBCPP_TEMPLATE_VIS is_constructible
                             ^~~~~~~~~~~~~~~~
In file included from /share/dim/src/libcxx/trunk/include/memory:648:0,
                 from test.cpp:1:
/share/dim/src/libcxx/trunk/include/memory:4444:5: error: template argument 1 
is invalid
     static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't 
construct object in allocate_shared" );
     ^

It could be a gcc problem, since clang does not complain about it, but hints on 
how to solve it would be welcome.

-Dimitry

Attachment: signature.asc
Description: Message signed with OpenPGP

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to