diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2012-07-03 19:24:07 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2012-07-03 19:24:07 +0000 |
commit | c128d2031e725201c1529564388b3bfb84872e35 (patch) | |
tree | 76d8012173d168c94a6139df0c0a26ff376e99ef /libstdc++-v3/testsuite | |
parent | f5d306802cc5327d9ee94eeae84765dab89a0104 (diff) | |
download | gcc-c128d2031e725201c1529564388b3bfb84872e35.zip gcc-c128d2031e725201c1529564388b3bfb84872e35.tar.gz gcc-c128d2031e725201c1529564388b3bfb84872e35.tar.bz2 |
re PR libstdc++/53840 ([C++11] DR 921. Rational Arithmetic should use template aliases)
2012-07-03 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/53840
* include/std/ratio (ratio_multiply, ratio_divide, ratio_add,
ratio_subtract): Use template aliases.
* include/std/chrono (duration<>::duration(const duration<>&),
duration_cast): Adjust.
* testsuite/20_util/ratio/operations/53840.cc: New.
* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust.
* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Likewise.
* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Likewise.
* testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Likewise.
From-SVN: r189239
Diffstat (limited to 'libstdc++-v3/testsuite')
5 files changed, 37 insertions, 10 deletions
diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc index 1e9c69e..a3671b0 100644 --- a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc +++ b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc @@ -3,7 +3,7 @@ // { dg-require-cstdint "" } // 2008-07-31 Chris Fairles <chris.fairles@gmail.com> -// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +// Copyright (C) 2008, 2009, 2010, 2011, 2012 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 @@ -31,5 +31,5 @@ void test01() test_type d; } -// { dg-error "rep cannot be a duration" "" { target *-*-* } 226 } +// { dg-error "rep cannot be a duration" "" { target *-*-* } 225 } // { dg-error "required from here" "" { target *-*-* } 31 } diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc index a3ab769..17d24e5 100644 --- a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc +++ b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc @@ -3,7 +3,7 @@ // { dg-require-cstdint "" } // 2008-07-31 Chris Fairles <chris.fairles@gmail.com> -// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. +// Copyright (C) 2008, 2009, 2010, 2011, 2012 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 @@ -32,5 +32,5 @@ void test01() test_type d; // { dg-error "required from here" } } -// { dg-error "must be a specialization of ratio" "" { target *-*-* } 227 } +// { dg-error "must be a specialization of ratio" "" { target *-*-* } 226 } // { dg-prune-output "not a member" } diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc index 940af7f..4b2df49 100644 --- a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc +++ b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc @@ -3,7 +3,7 @@ // { dg-require-cstdint "" } // 2008-07-31 Chris Fairles <chris.fairles@gmail.com> -// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +// Copyright (C) 2008, 2009, 2010, 2011, 2012 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 @@ -33,5 +33,5 @@ void test01() test_type d; } -// { dg-error "period must be positive" "" { target *-*-* } 229 } +// { dg-error "period must be positive" "" { target *-*-* } 228 } // { dg-error "required from here" "" { target *-*-* } 33 } diff --git a/libstdc++-v3/testsuite/20_util/ratio/operations/53840.cc b/libstdc++-v3/testsuite/20_util/ratio/operations/53840.cc new file mode 100644 index 0000000..780c321 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/ratio/operations/53840.cc @@ -0,0 +1,27 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } +// { dg-do compile } + +// Copyright (C) 2012 Free Software Foundation +// +// 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/>. + +#include <chrono> + +std::chrono::duration<long, std::ratio_divide<std::kilo, std::milli>> d1; +std::chrono::duration<long, std::ratio_multiply<std::kilo, std::milli>> d2; +std::chrono::duration<long, std::ratio_add<std::kilo, std::milli>> d3; +std::chrono::duration<long, std::ratio_subtract<std::kilo, std::milli>> d4; diff --git a/libstdc++-v3/testsuite/20_util/ratio/operations/ops_overflow_neg.cc b/libstdc++-v3/testsuite/20_util/ratio/operations/ops_overflow_neg.cc index 51a6bf6..150aef6 100644 --- a/libstdc++-v3/testsuite/20_util/ratio/operations/ops_overflow_neg.cc +++ b/libstdc++-v3/testsuite/20_util/ratio/operations/ops_overflow_neg.cc @@ -4,7 +4,7 @@ // 2008-07-03 Chris Fairles <chris.fairles@gmail.com> -// Copyright (C) 2008, 2009, 2011 Free Software Foundation +// Copyright (C) 2008, 2009, 2011, 2012 Free Software Foundation // // 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 @@ -40,9 +40,9 @@ test02() } // { dg-error "required from here" "" { target *-*-* } 29 } -// { dg-error "required from here" "" { target *-*-* } 36 } -// { dg-error "required from here" "" { target *-*-* } 38 } -// { dg-error "overflow in addition" "" { target *-*-* } 429 } +// { dg-error "expected initializer" "" { target *-*-* } 36 } +// { dg-error "expected initializer" "" { target *-*-* } 38 } +// { dg-error "overflow in addition" "" { target *-*-* } 435 } // { dg-error "overflow in multiplication" "" { target *-*-* } 97 } // { dg-error "overflow in multiplication" "" { target *-*-* } 99 } // { dg-error "overflow in multiplication" "" { target *-*-* } 101 } |