]> gcc.gnu.org Git - gcc.git/commit
libstdc++: Check static assertions earlier in chrono::duration
authorJonathan Wakely <jwakely@redhat.com>
Mon, 21 Nov 2022 11:52:34 +0000 (11:52 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 24 Nov 2022 13:47:29 +0000 (13:47 +0000)
commitd9b0e012ab939568f5ccbefc4a68ba515e66f4b5
tree6554da8cba2d637c5757fe685e2fe012ca04775a
parent6e3b2c0d5e676e1cba1c27b95dd850e5cc33f9e1
libstdc++: Check static assertions earlier in chrono::duration

This ensures that we fail a static assertion before giving any other
errors. Instantiating chrono::duration<int, chrono::seconds> will now
print this before the other errors caused by it:

error: static assertion failed: period must be a specialization of ratio

libstdc++-v3/ChangeLog:

* include/bits/chrono.h (duration): Check preconditions on
template arguments before using them.

(cherry picked from commit ed77dcb9be76e592b62449c75a5e751485514afd)
libstdc++-v3/include/bits/chrono.h
This page took 0.061569 seconds and 6 git commands to generate.