Help test MSVC 14 CTP compiler
Hi Everyone,
I am trying to determine the root cause of the failure in one of
Boost.Optional regression tests. Namely:
http://www.boost.org/development/tests/develop/developer/output/teeks99-08f-...
Could anyone with the access to MSVC 14 CTP compiler check if the following
code compiles?
// BEGIN CODE
#include
#include
#include struct NothrowCtor { NothrowCtor(NothrowCtor&&) BOOST_NOEXCEPT_IF(true) {}; void operator=(NothrowCtor&&) BOOST_NOEXCEPT_IF(false) {}; };
BOOST_STATIC_ASSERT(!::boost::is_nothrow_move_assignable<NothrowCtor>::value);
int main() {}
It fails. In fact I can't seem to get is_nothrow_move_assignable to return anything other than true for that compiler :( Will investigate, John.
#include
#include struct NothrowCtor { NothrowCtor(NothrowCtor&&) BOOST_NOEXCEPT_IF(true) {}; void operator=(NothrowCtor&&) BOOST_NOEXCEPT_IF(false) {}; };
BOOST_STATIC_ASSERT(!::boost::is_nothrow_move_assignable<NothrowCtor>::value);
int main() {}
Update: in the absence of SFINAE expression support, a number of type_traits are terminally broken, and this is one I'm afraid. John.
2014-12-02 14:08 GMT+01:00 John Maddock
#include
#include
struct NothrowCtor { NothrowCtor(NothrowCtor&&) BOOST_NOEXCEPT_IF(true) {}; void operator=(NothrowCtor&&) BOOST_NOEXCEPT_IF(false) {}; };
BOOST_STATIC_ASSERT(!::boost::is_nothrow_move_assignable< NothrowCtor>::value);
int main() {}
Update: in the absence of SFINAE expression support, a number of type_traits are terminally broken, and this is one I'm afraid.
Can't operator noexcept() be used to implement it w/o SFINAE?
2014-12-02 14:08 GMT+01:00 John Maddock
#include
#include
struct NothrowCtor { NothrowCtor(NothrowCtor&&) BOOST_NOEXCEPT_IF(true) {}; void operator=(NothrowCtor&&) BOOST_NOEXCEPT_IF(false) {}; };
BOOST_STATIC_ASSERT(!::boost::is_nothrow_move_assignable< NothrowCtor>::value);
int main() {}
Update: in the absence of SFINAE expression support, a number of type_traits are terminally broken, and this is one I'm afraid.
If this is unimplementable, then that's fine. What I find confusing is that regression tests for is_nothrow_move_assignable pass on this compiler: http://www.boost.org/development/tests/develop/developer/type_traits.html
On 2014-12-02 14:29, Andrzej Krzemienski wrote:
2014-12-02 14:08 GMT+01:00 John Maddock
: #include
#include
struct NothrowCtor { NothrowCtor(NothrowCtor&&) BOOST_NOEXCEPT_IF(true) {}; void operator=(NothrowCtor&&) BOOST_NOEXCEPT_IF(false) {}; };
BOOST_STATIC_ASSERT(!::boost::is_nothrow_move_assignable< NothrowCtor>::value);
int main() {}
Update: in the absence of SFINAE expression support, a number of type_traits are terminally broken, and this is one I'm afraid.
If this is unimplementable, then that's fine. What I find confusing is that regression tests for is_nothrow_move_assignable pass on this compiler: http://www.boost.org/development/tests/develop/developer/type_traits.html
The compiler has an __is_nothrow_assignable() built-in, which seems
usable here.
The standard says that is_nothrow_move_assignable<T> is the same as
is_nothrow_assignable
Update: in the absence of SFINAE expression support, a number of type_traits are terminally broken, and this is one I'm afraid.
If this is unimplementable, then that's fine. What I find confusing is that regression tests for is_nothrow_move_assignable pass on this compiler: http://www.boost.org/development/tests/develop/developer/type_traits.html
The compiler has an __is_nothrow_assignable() built-in, which seems usable here.
The standard says that is_nothrow_move_assignable<T> is the same as is_nothrow_assignable
.
Will investigate. BTW the current implementation does use noexcept - the issue is that in some situations this leads to noexcept(expression-that-doesn't-compile) which requires SFINAE-expression support. John.
The compiler has an __is_nothrow_assignable() built-in, which seems usable here.
The standard says that is_nothrow_move_assignable<T> is the same as is_nothrow_assignable
. Will investigate.
is_nothrow_move_assignable/constructible should now be fixed for msvc-12 and later in develop. John.
2014-12-05 19:33 GMT+01:00 John Maddock
The compiler has an __is_nothrow_assignable() built-in, which seems
usable here.
The standard says that is_nothrow_move_assignable<T> is the same as is_nothrow_assignable
. Will investigate.
is_nothrow_move_assignable/constructible should now be fixed for msvc-12 and later in develop.
Thanks! When can we expect it in branch master?
[Bo Persson]
The compiler has an __is_nothrow_assignable() built-in, which seems usable here.
Yeah, that's what VC's STL uses. Specifically: * Obviously library-only type traits are implemented with library code. * "Derived" type traits like is_nothrow_move_assignable are implemented in terms of "base" type traits like is_nothrow_assignable, as depicted by the Standard. * "Base" type traits are implemented by invoking compiler hooks directly. In previous versions, the STL sometimes compensated for compiler hooks behaving differently than the Standard Library's requirements, but over the years we've gotten compiler changes so we can just return whatever the hooks do. The only exceptions to this rule (that I can think of right now) are is_assignable (which probably *should* be powered by a hook like its trivial/nothrow cousins, but instead is written with Expression SFINAE by special dispensation) and aligned_storage/union (which cannot be powered by alignas yet; it uses library tech instead). The compiler hooks are undocumented, but because the STL uses them, Boost can use them too. Please report any bugs you encounter so both libraries can benefit. (The compiler team has been fixing several reported bugs in the hooks; 2015 RTM will report more accurate answers than ever before.) STL
On 2014-12-02 18:46, Stephan T. Lavavej wrote:
[Bo Persson]
The compiler has an __is_nothrow_assignable() built-in, which seems usable here.
Yeah, that's what VC's STL uses. ... The compiler hooks are undocumented, but because the STL uses them, Boost can use them too. Please report any bugs you encounter so both libraries can benefit. (The compiler team has been fixing several reported bugs in the hooks; 2015 RTM will report more accurate answers than ever before.)
Some of them are documented (or at least listed) by Clang, when they try to be compatible with other compilers. See http://clang.llvm.org/docs/LanguageExtensions.html#checks-for-type-trait-pri... Bo Persson
On Tue, Dec 2, 2014 at 1:51 PM, Andrzej Krzemienski
Hi Everyone, I am trying to determine the root cause of the failure in one of Boost.Optional regression tests. Namely:
http://www.boost.org/development/tests/develop/developer/output/teeks99-08f-...
Could anyone with the access to MSVC 14 CTP compiler check if the following code compiles?
// BEGIN CODE
#include
#include struct NothrowCtor { NothrowCtor(NothrowCtor&&) BOOST_NOEXCEPT_IF(true) {}; void operator=(NothrowCtor&&) BOOST_NOEXCEPT_IF(false) {}; };
BOOST_STATIC_ASSERT(!::boost::is_nothrow_move_assignable<NothrowCtor>::value);
int main() {}
// END CODE
Regards, &rzej
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
With VS2015 Preview I get: 1>------ Build started: Project: TestBoostMl, Configuration: Debug Win32 ------ 1> main.cpp 1> Unknown compiler version - please run the configure tests and report the results 1>c:\users\jlamotte\documents\visual studio 14\projects\testboostml\testboostml\main.cpp(11): error C2338: !::boost::is_nothrow_move_assignable<NothrowCtor>::value ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
participants (5)
-
Andrzej Krzemienski
-
Bo Persson
-
John Maddock
-
Klaim - Joël Lamotte
-
Stephan T. Lavavej