fix bug with defaulted move in msvc 12.0

This commit is contained in:
Andrzej Krzemienski
2017-10-31 01:26:18 +01:00
parent ebef3ed6f7
commit 58f7c2f14a
10 changed files with 58 additions and 14 deletions

View File

@ -67,12 +67,14 @@ import testing ;
[ compile-fail optional_test_fail_none_io_without_io.cpp ]
[ compile-fail optional_test_fail_convert_assign_of_enums.cpp ]
[ run optional_test_static_properties.cpp ]
[ compile optional_test_maybe_uninitialized_warning.cpp ]
[ compile optional_test_deleted_default_ctor.cpp ]
[ run optional_xconfig_NO_PROPER_ASSIGN_FROM_CONST_INT_pass.cpp ]
[ run-fail optional_xconfig_NO_PROPER_ASSIGN_FROM_CONST_INT_fail.cpp ]
[ run optional_xconfig_NO_PROPER_CONVERT_FROM_CONST_INT_pass.cpp ]
[ run-fail optional_xconfig_NO_PROPER_CONVERT_FROM_CONST_INT_fail.cpp ]
[ run optional_xconfig_NO_LEGAL_CONVERT_FROM_REF_pass.cpp ]
[ compile-fail optional_xconfig_NO_LEGAL_CONVERT_FROM_REF_fail.cpp ]
[ compile optional_test_deleted_default_ctor.cpp ]
;
}

View File

@ -21,7 +21,6 @@
#include "boost/core/lightweight_test.hpp"
using boost::optional;
using boost::make_optional;
template<class Opt>
void test2( Opt o, Opt buff )
@ -42,10 +41,10 @@ void test2( Opt o, Opt buff )
template<class T>
void test( T v, T w )
{
test2( make_optional(v), optional<T> ());
test2( make_optional(v), make_optional(w));
test2( boost::make_optional(v), optional<T> ());
test2( boost::make_optional(v), boost::make_optional(w));
test2( optional<T> () , optional<T> ());
test2( optional<T> () , make_optional(w));
test2( optional<T> () , boost::make_optional(w));
}

View File

@ -0,0 +1,32 @@
// Copyright (C) 2017 Andrzej Krzemienski.
//
// Use, modification, and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/lib/optional for documentation.
//
// You are welcome to contact the author at:
// akrzemi1@gmail.com
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
boost::optional<int> getitem();
int main(int argc, const char *[])
{
boost::optional<int> a = getitem();
boost::optional<int> b;
if (argc > 0)
b = argc;
if (a != b)
return 1;
return 0;
}

View File

@ -137,4 +137,4 @@ int main()
test_trivial_copyability();
#endif
return boost::report_errors();
}
}