This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/54025] atomic<chrono::duration> won't compile: chrono::duration::duration() is not C++11 compliant


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54025

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-07-19 12:06:32 UTC ---
I think that test is wrong, a duration is only constexpr_default_constructible
if the rep type has a default-constructor, but std::chrono::seconds uses a
scalar rep.

I think the test should use something like this to check duration is
constexpr-default-constructible:

struct Seconds {
    constexpr Seconds() = default;
    std::chrono::seconds s{};
};
test1.operator()<std::chrono::duration<Seconds>>();


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]