public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/53840] New: [C++11] DR 921. Rational Arithmetic should use template aliases
@ 2012-07-03 15:05 redi at gcc dot gnu.org
2012-07-03 16:27 ` [Bug libstdc++/53840] " paolo.carlini at oracle dot com
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2012-07-03 15:05 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53840
Bug #: 53840
Summary: [C++11] DR 921. Rational Arithmetic should use
template aliases
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: redi@gcc.gnu.org
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3358.html#921
This should compile:
#include <chrono>
std::chrono::duration<long, std::ratio_divide<std::kilo, std::milli>> d;
/home/jwakely/gcc/4.x/include/c++/4.8.0/chrono:227:2: error: static assertion
failed: period must be a specialization of ratio
static_assert(__is_ratio<_Period>::value,
^
The obvious implementation would be to rename each ratio_xxx class template to
__ratio_xxx then add:
template<typename _R1, typename _R2>
using ratio_xxx = typename __ratio_xxx<_R1, _R2>::type;
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug libstdc++/53840] [C++11] DR 921. Rational Arithmetic should use template aliases
2012-07-03 15:05 [Bug libstdc++/53840] New: [C++11] DR 921. Rational Arithmetic should use template aliases redi at gcc dot gnu.org
@ 2012-07-03 16:27 ` paolo.carlini at oracle dot com
2012-07-03 19:24 ` paolo at gcc dot gnu.org
2012-07-03 19:25 ` paolo.carlini at oracle dot com
2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-07-03 16:27 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53840
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2012-07-03
AssignedTo|unassigned at gcc dot |paolo.carlini at oracle dot
|gnu.org |com
Target Milestone|--- |4.8.0
Ever Confirmed|0 |1
--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-07-03 16:27:30 UTC ---
Can do this now.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug libstdc++/53840] [C++11] DR 921. Rational Arithmetic should use template aliases
2012-07-03 15:05 [Bug libstdc++/53840] New: [C++11] DR 921. Rational Arithmetic should use template aliases redi at gcc dot gnu.org
2012-07-03 16:27 ` [Bug libstdc++/53840] " paolo.carlini at oracle dot com
@ 2012-07-03 19:24 ` paolo at gcc dot gnu.org
2012-07-03 19:25 ` paolo.carlini at oracle dot com
2 siblings, 0 replies; 4+ messages in thread
From: paolo at gcc dot gnu.org @ 2012-07-03 19:24 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53840
--- Comment #2 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> 2012-07-03 19:24:15 UTC ---
Author: paolo
Date: Tue Jul 3 19:24:07 2012
New Revision: 189239
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189239
Log:
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.
Added:
trunk/libstdc++-v3/testsuite/20_util/ratio/operations/53840.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/std/chrono
trunk/libstdc++-v3/include/std/ratio
trunk/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc
trunk/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc
trunk/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc
trunk/libstdc++-v3/testsuite/20_util/ratio/operations/ops_overflow_neg.cc
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug libstdc++/53840] [C++11] DR 921. Rational Arithmetic should use template aliases
2012-07-03 15:05 [Bug libstdc++/53840] New: [C++11] DR 921. Rational Arithmetic should use template aliases redi at gcc dot gnu.org
2012-07-03 16:27 ` [Bug libstdc++/53840] " paolo.carlini at oracle dot com
2012-07-03 19:24 ` paolo at gcc dot gnu.org
@ 2012-07-03 19:25 ` paolo.carlini at oracle dot com
2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-07-03 19:25 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53840
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-07-03 19:25:13 UTC ---
Done.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-07-03 19:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-03 15:05 [Bug libstdc++/53840] New: [C++11] DR 921. Rational Arithmetic should use template aliases redi at gcc dot gnu.org
2012-07-03 16:27 ` [Bug libstdc++/53840] " paolo.carlini at oracle dot com
2012-07-03 19:24 ` paolo at gcc dot gnu.org
2012-07-03 19:25 ` paolo.carlini at oracle dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).