Title
Overflow cannot be ill-formed for chrono::duration integer literals
Status
open
Section
[time.duration.literals]
Submitter
Jonathan Wakely

Created on 2014-05-16.00:00:00 last changed 122 months ago

Messages

Date: 2014-11-08.16:43:57

[ Urbana 2014-11-07: Move to Open ]

Date: 2014-05-16.00:00:00

[time.duration.literals] p3 says:

If any of these suffixes are applied to an integer literal and the resulting chrono::duration value cannot be represented in the result type because of overflow, the program is ill-formed.

Ill-formed requires a diagnostic at compile-time, but there is no way to detect the overflow from unsigned long long to the signed duration<>::rep type.

Overflow could be detected if the duration integer literals were literal operator templates, otherwise overflow can either be undefined or a run-time error, not ill-formed.

History
Date User Action Args
2014-11-08 16:43:57adminsetmessages: + msg7173
2014-11-08 16:43:57adminsetstatus: new -> open
2014-05-16 00:00:00admincreate