diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/boost/libs/multiprecision/test/compile_fail | |
parent | Initial commit. (diff) | |
download | ceph-upstream.tar.xz ceph-upstream.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/libs/multiprecision/test/compile_fail')
78 files changed, 1195 insertions, 0 deletions
diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_01.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_01.cpp new file mode 100644 index 00000000..c5edc3b0 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_01.cpp @@ -0,0 +1,17 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +void foo(cpp_int i) +{ +} + +int main() +{ + foo(2.3); // conversion from float is explicit +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_02.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_02.cpp new file mode 100644 index 00000000..79ffff2f --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_02.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i = 2; + i == 2.3; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_03.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_03.cpp new file mode 100644 index 00000000..0fe89320 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_03.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i = 2; + i != 2.3; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_04.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_04.cpp new file mode 100644 index 00000000..6bd72119 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_04.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i = 2; + i <= 2.3; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_05.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_05.cpp new file mode 100644 index 00000000..23f49022 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_05.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i = 2; + i >= 2.3; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_06.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_06.cpp new file mode 100644 index 00000000..78fea0f7 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_06.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i = 2; + i > 2.3; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_07.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_07.cpp new file mode 100644 index 00000000..af4286f4 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_07.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i = 2; + i < 2.3; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_08.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_08.cpp new file mode 100644 index 00000000..aa2baa64 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_08.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i = 2; + i = 2.3; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_09.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_09.cpp new file mode 100644 index 00000000..29ce8b7b --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_09.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i = 2; + i += 2.3; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_10.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_10.cpp new file mode 100644 index 00000000..d4376a2b --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_10.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i = 2; + i -= 2.3; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_11.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_11.cpp new file mode 100644 index 00000000..b07a8b89 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_11.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i = 2; + i *= 2.3; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_12.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_12.cpp new file mode 100644 index 00000000..fbaf8fae --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_12.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i = 2; + i /= 2.3; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_13.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_13.cpp new file mode 100644 index 00000000..1d705e7f --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_13.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i = 2; + i %= 2.3; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_14.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_14.cpp new file mode 100644 index 00000000..54b86232 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_14.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i = 2; + i |= 2.3; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_15.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_15.cpp new file mode 100644 index 00000000..e225a870 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_15.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i = 2; + i ^= 2.3; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_16.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_16.cpp new file mode 100644 index 00000000..0ba8c25b --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_16.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i = 2; + i &= 2.3; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_18.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_18.cpp new file mode 100644 index 00000000..451d702f --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_18.cpp @@ -0,0 +1,16 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_50 a(2), b(3); + cpp_int i(2); + i = a; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_20.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_20.cpp new file mode 100644 index 00000000..f75ecff9 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_20.cpp @@ -0,0 +1,16 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_50 a(2), b(3); + cpp_int i(3); + i = a * b; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_21.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_21.cpp new file mode 100644 index 00000000..b8de1e2f --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_21.cpp @@ -0,0 +1,16 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_50 a(2), b(3); + cpp_int i(3); + i += a * b; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_22.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_22.cpp new file mode 100644 index 00000000..b16bda19 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_22.cpp @@ -0,0 +1,16 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_50 a(2), b(3); + cpp_int i(3); + i -= a * b; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_23.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_23.cpp new file mode 100644 index 00000000..35a5288e --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_23.cpp @@ -0,0 +1,16 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_50 a(2), b(3); + cpp_int i(3); + i *= a * b; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_24.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_24.cpp new file mode 100644 index 00000000..5b7daa2c --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_24.cpp @@ -0,0 +1,16 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_50 a(2), b(3); + cpp_int i(3); + i /= a * b; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_25.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_25.cpp new file mode 100644 index 00000000..80de61c9 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_25.cpp @@ -0,0 +1,16 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_50 a(2), b(3); + cpp_int i(3); + i %= a * b; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_26.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_26.cpp new file mode 100644 index 00000000..5b27aa53 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_26.cpp @@ -0,0 +1,16 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_50 a(2), b(3); + cpp_int i(3); + i &= a * b; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_27.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_27.cpp new file mode 100644 index 00000000..43bddb93 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_27.cpp @@ -0,0 +1,16 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_50 a(2), b(3); + cpp_int i(3); + i |= a * b; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_28.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_28.cpp new file mode 100644 index 00000000..773569eb --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_28.cpp @@ -0,0 +1,16 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_50 a(2), b(3); + cpp_int i(3); + i ^= a * b; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_29.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_29.cpp new file mode 100644 index 00000000..854118fb --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_29.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i(3), j; + j = i + 3.3; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_30.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_30.cpp new file mode 100644 index 00000000..4ba78fe5 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_30.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i(3), j; + j = 3.3 + i; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_31.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_31.cpp new file mode 100644 index 00000000..56a14828 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_31.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i(3), j; + j = 3.3 - i; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_32.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_32.cpp new file mode 100644 index 00000000..1769185f --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_32.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i(3), j; + j = i - 3.3; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_33.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_33.cpp new file mode 100644 index 00000000..36758318 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_33.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i(3), j; + j = i * 3.3; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_34.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_34.cpp new file mode 100644 index 00000000..7d178c48 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_34.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i(3), j; + j = 3.3 * i; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_35.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_35.cpp new file mode 100644 index 00000000..67f6bdc8 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_35.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i(3), j; + j = 3.3 / i; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_36.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_36.cpp new file mode 100644 index 00000000..3b175be8 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_36.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i(3), j; + j = i / 3.3; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_37.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_37.cpp new file mode 100644 index 00000000..164db0b9 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_37.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i(3), j; + j = i % 3.3; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_38.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_38.cpp new file mode 100644 index 00000000..a905e20e --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_38.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i(3), j; + j = 3.3 % i; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_39.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_39.cpp new file mode 100644 index 00000000..fa495d70 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_39.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i(3), j; + j = 3.3 & i; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_40.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_40.cpp new file mode 100644 index 00000000..f3ccf05b --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_40.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i(3), j; + j = i & 3.3; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_41.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_41.cpp new file mode 100644 index 00000000..67c30945 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_41.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i(3), j; + j = i | 3.3; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_42.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_42.cpp new file mode 100644 index 00000000..6ebe5f5b --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_42.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i(3), j; + j = 3.3 | i; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_43.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_43.cpp new file mode 100644 index 00000000..cac2c020 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_43.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i(3), j; + j = 3.3 ^ i; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_44.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_44.cpp new file mode 100644 index 00000000..32a27593 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_44.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i(3), j; + j = i ^ 3.3; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_45.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_45.cpp new file mode 100644 index 00000000..64d05679 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_45.cpp @@ -0,0 +1,24 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#ifdef TEST_GMP + +#include <boost/multiprecision/gmp.hpp> + +using namespace boost::multiprecision; + +void foo(mpz_int i); + +int main() +{ + mpf_t f + foo(f); +} + +#else + +#error "Nothing to test without GMP!" + +#endif diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_46.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_46.cpp new file mode 100644 index 00000000..acf305ed --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_46.cpp @@ -0,0 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#ifdef TEST_GMP + +#include <boost/multiprecision/gmp.hpp> + +using namespace boost::multiprecision; + +int main() +{ + mpf_t f; + mpz_int i; + i = f; +} + +#else + +#error "Nothing to test without GMP!" + +#endif diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_47.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_47.cpp new file mode 100644 index 00000000..b385e988 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_47.cpp @@ -0,0 +1,24 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#ifdef TEST_GMP + +#include <boost/multiprecision/gmp.hpp> + +using namespace boost::multiprecision; + +void foo(mpf_float_50); + +int main() +{ + mpf_float_100 f(2); + foo(f); +} + +#else + +#error "Nothing to test without GMP!" + +#endif diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_48.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_48.cpp new file mode 100644 index 00000000..d43fa028 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_48.cpp @@ -0,0 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#ifdef TEST_GMP + +#include <boost/multiprecision/gmp.hpp> + +using namespace boost::multiprecision; + +int main() +{ + mpf_float_100 f(2); + mpf_float_50 f2; + f2 = f; +} + +#else + +#error "Nothing to test without GMP!" + +#endif diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_49.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_49.cpp new file mode 100644 index 00000000..47fe90e3 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_49.cpp @@ -0,0 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#ifdef TEST_MPFR + +#include <boost/multiprecision/mpfr.hpp> + +using namespace boost::multiprecision; + +int main() +{ + mpfr_float_100 f(2); + mpfr_float_50 f2; + f2 = f; +} + +#else + +#error "Nothing to test without GMP!" + +#endif diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_50.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_50.cpp new file mode 100644 index 00000000..428ee49e --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_50.cpp @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#ifdef TEST_MPFR + +#include <boost/multiprecision/mpfr.hpp> + +using namespace boost::multiprecision; + +int main() +{ + mpfr_float_100 f(2); + mpfr_float_50 f2 = f; +} + +#else + +#error "Nothing to test without GMP!" + +#endif diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_51.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_51.cpp new file mode 100644 index 00000000..b247852d --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_51.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_100 f(2); + cpp_dec_float_50 f2 = f; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_52.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_52.cpp new file mode 100644 index 00000000..2044f588 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_52.cpp @@ -0,0 +1,15 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_100 f(2); + cpp_dec_float_50 f2; + f2 = f; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_53.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_53.cpp new file mode 100644 index 00000000..1f7739b4 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_53.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + int256_t i = 3; + int128_t j = i; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_54.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_54.cpp new file mode 100644 index 00000000..31c5057b --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_54.cpp @@ -0,0 +1,15 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + int256_t i = 3; + int128_t j; + j = i; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_55.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_55.cpp new file mode 100644 index 00000000..cf36c9d2 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_55.cpp @@ -0,0 +1,15 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + int256_t i = 3; + uint256_t j; + j = i; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_56.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_56.cpp new file mode 100644 index 00000000..f252447f --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_56.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + int256_t i = 3; + uint256_t j = i; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_57.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_57.cpp new file mode 100644 index 00000000..18ce27ed --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_57.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i = 3; + int256_t j = i; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_58.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_58.cpp new file mode 100644 index 00000000..9ecdc388 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_58.cpp @@ -0,0 +1,15 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i = 3; + int256_t j; + j = i; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/conv_fail_59.cpp b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_59.cpp new file mode 100644 index 00000000..2b911e91 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/conv_fail_59.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_int i(1), j(3); + void* p = i * j; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/cpp_int_complement.cpp b/src/boost/libs/multiprecision/test/compile_fail/cpp_int_complement.cpp new file mode 100644 index 00000000..195d94e7 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/cpp_int_complement.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + checked_int256_t i; + i = ~i; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/cpp_int_negate_1.cpp b/src/boost/libs/multiprecision/test/compile_fail/cpp_int_negate_1.cpp new file mode 100644 index 00000000..35fa0abc --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/cpp_int_negate_1.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + checked_uint256_t i; + i = -i; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/cpp_int_negate_2.cpp b/src/boost/libs/multiprecision/test/compile_fail/cpp_int_negate_2.cpp new file mode 100644 index 00000000..5b75cf09 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/cpp_int_negate_2.cpp @@ -0,0 +1,14 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + number<cpp_int_backend<32, 32, unsigned_magnitude>, et_on> i; + i = -i; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/operator_fail_01.cpp b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_01.cpp new file mode 100644 index 00000000..809c4cc6 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_01.cpp @@ -0,0 +1,16 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + number<cpp_dec_float<50>, et_on> a(2); + number<cpp_dec_float<50>, et_off> b(2); + + a = a + b; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/operator_fail_02.cpp b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_02.cpp new file mode 100644 index 00000000..09d5f39e --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_02.cpp @@ -0,0 +1,17 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_dec_float.hpp> +#include <boost/multiprecision/cpp_int.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_50 a(2); + cpp_int b(2); + + a = a + b; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/operator_fail_03.cpp b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_03.cpp new file mode 100644 index 00000000..c776c0d3 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_03.cpp @@ -0,0 +1,15 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_50 a(2), b(3); + auto x = a + b; + ++x; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/operator_fail_04.cpp b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_04.cpp new file mode 100644 index 00000000..098f8281 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_04.cpp @@ -0,0 +1,15 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_50 a(2), b(3); + auto x = a + b; + x++; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/operator_fail_05.cpp b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_05.cpp new file mode 100644 index 00000000..b708cd61 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_05.cpp @@ -0,0 +1,15 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_50 a(2), b(3); + auto x = a + b; + x--; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/operator_fail_06.cpp b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_06.cpp new file mode 100644 index 00000000..b6c1cb8c --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_06.cpp @@ -0,0 +1,15 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_50 a(2), b(3); + auto x = a + b; + --x; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/operator_fail_07.cpp b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_07.cpp new file mode 100644 index 00000000..b72732e6 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_07.cpp @@ -0,0 +1,15 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_50 a(2), b(3); + auto x = a + b; + x += a; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/operator_fail_08.cpp b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_08.cpp new file mode 100644 index 00000000..9c8b3566 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_08.cpp @@ -0,0 +1,15 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_50 a(2), b(3); + auto x = a + b; + x -= a; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/operator_fail_09.cpp b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_09.cpp new file mode 100644 index 00000000..88952b97 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_09.cpp @@ -0,0 +1,15 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_50 a(2), b(3); + auto x = a + b; + x *= a; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/operator_fail_10.cpp b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_10.cpp new file mode 100644 index 00000000..731054b9 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_10.cpp @@ -0,0 +1,15 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_50 a(2), b(3); + auto x = a + b; + x /= a; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/operator_fail_11.cpp b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_11.cpp new file mode 100644 index 00000000..54406bf2 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_11.cpp @@ -0,0 +1,15 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_50 a(2), b(3); + auto x = a + b; + x %= a; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/operator_fail_12.cpp b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_12.cpp new file mode 100644 index 00000000..c01fc680 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_12.cpp @@ -0,0 +1,15 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_50 a(2), b(3); + auto x = a + b; + x |= a; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/operator_fail_13.cpp b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_13.cpp new file mode 100644 index 00000000..0eacd3be --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_13.cpp @@ -0,0 +1,15 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_50 a(2), b(3); + auto x = a + b; + x &= a; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/operator_fail_14.cpp b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_14.cpp new file mode 100644 index 00000000..6b8d3176 --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_14.cpp @@ -0,0 +1,15 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_50 a(2), b(3); + auto x = a + b; + x ^= a; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/operator_fail_15.cpp b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_15.cpp new file mode 100644 index 00000000..cab669db --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_15.cpp @@ -0,0 +1,15 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_50 a(2), b(3); + auto x = a + b; + x >>= 2; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/operator_fail_16.cpp b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_16.cpp new file mode 100644 index 00000000..458eab9e --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_16.cpp @@ -0,0 +1,15 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_50 a(2), b(3); + auto x = a + b; + x <<= 2; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/operator_fail_17.cpp b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_17.cpp new file mode 100644 index 00000000..97ebdd7e --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_17.cpp @@ -0,0 +1,15 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_50 a(2), b(3); + auto x = a + b; + x = 2; +} diff --git a/src/boost/libs/multiprecision/test/compile_fail/operator_fail_18.cpp b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_18.cpp new file mode 100644 index 00000000..e5adb31f --- /dev/null +++ b/src/boost/libs/multiprecision/test/compile_fail/operator_fail_18.cpp @@ -0,0 +1,15 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under 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) + +#include <boost/multiprecision/cpp_dec_float.hpp> + +using namespace boost::multiprecision; + +int main() +{ + cpp_dec_float_50 a(2), b(3); + auto x = a + b; + x = a; +} |