aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/decimal
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2013-10-23 11:48:26 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2013-10-23 11:48:26 +0000
commit1a0e9d1cb917e2d788a85cfb374ca9fb62bccf90 (patch)
treeabfafd40add6d5022e14f389c0552911026b882f /libstdc++-v3/testsuite/decimal
parentfe15a1a7eb43bf486577d55e650222fb3479554f (diff)
downloadgcc-1a0e9d1cb917e2d788a85cfb374ca9fb62bccf90.zip
gcc-1a0e9d1cb917e2d788a85cfb374ca9fb62bccf90.tar.gz
gcc-1a0e9d1cb917e2d788a85cfb374ca9fb62bccf90.tar.bz2
re PR libstdc++/58815 (Casting/Conversion operator for std::decimal not supported)
2013-10-23 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/58815 * include/decimal/decimal (decimal32::operator long long(), decimal64::operator long long(), decimal128::operator long long()): Add in c++11 mode per n3407. * testsuite/decimal/pr58815.cc: New. From-SVN: r203956
Diffstat (limited to 'libstdc++-v3/testsuite/decimal')
-rw-r--r--libstdc++-v3/testsuite/decimal/pr58815.cc35
1 files changed, 35 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/decimal/pr58815.cc b/libstdc++-v3/testsuite/decimal/pr58815.cc
new file mode 100644
index 0000000..b805d75
--- /dev/null
+++ b/libstdc++-v3/testsuite/decimal/pr58815.cc
@@ -0,0 +1,35 @@
+// { dg-options "-std=gnu++11" }
+//
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do compile }
+// { dg-require-effective-target dfp }
+
+#include <decimal/decimal>
+
+void
+test01 ()
+{
+ std::decimal::decimal32 d32;
+ std::decimal::decimal64 d64;
+ std::decimal::decimal128 d128;
+
+ static_cast<long long>(d32);
+ static_cast<long long>(d64);
+ static_cast<long long>(d128);
+}