public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/54025] New: atomic<chrono::duration> won't compile: chrono::duration::duration() is not C++11 compliant
@ 2012-07-19  2:55 chip at pobox dot com
  2012-07-19  2:57 ` [Bug libstdc++/54025] " chip at pobox dot com
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: chip at pobox dot com @ 2012-07-19  2:55 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 54025
           Summary: atomic<chrono::duration> won't compile:
                    chrono::duration::duration() is not C++11 compliant
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: chip@pobox.com


Attempting to compile atomic<duration> fails, because the duration default
constructor is not " = default" as required by the standard, but instead
explicitly initializes its representation.  Here is what libstdc++ says:

    constexpr duration() : __r() { }

but here is what the standard says should be there, and if I make the change,
compilation succeeds:

    constexpr duration() = default;

Test source:

#include <atomic>
#include <chrono>
using namespace std;
using namespace chrono;
int main() {
    atomic<duration<long, micro>> dur;
}

Error before patch:

/usr/include/c++/4.7/atomic: In instantiation of ‘struct
std::atomic<std::chrono::duration<long int, std::ratio<1ll, 1000000ll> > >’:
atdur.cc:6:35:   required from here
/usr/include/c++/4.7/atomic:160:7: error: function ‘std::atomic<_Tp>::atomic()
[with _Tp = std::chrono::duration<long int, std::ratio<1ll, 1000000ll> >]’
defaulted on its first declaration with an exception-specification that differs
from the implicit declaration ‘constexpr std::atomic<std::chrono::duration<long
int, std::ratio<1ll, 1000000ll> > >::atomic()’


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2012-07-20  9:51 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-19  2:55 [Bug libstdc++/54025] New: atomic<chrono::duration> won't compile: chrono::duration::duration() is not C++11 compliant chip at pobox dot com
2012-07-19  2:57 ` [Bug libstdc++/54025] " chip at pobox dot com
2012-07-19  8:34 ` redi at gcc dot gnu.org
2012-07-19  9:40 ` paolo.carlini at oracle dot com
2012-07-19 10:20 ` redi at gcc dot gnu.org
2012-07-19 11:57 ` paolo.carlini at oracle dot com
2012-07-19 12:06 ` redi at gcc dot gnu.org
2012-07-19 12:08 ` redi at gcc dot gnu.org
2012-07-19 12:17 ` paolo.carlini at oracle dot com
2012-07-19 12:19 ` redi at gcc dot gnu.org
2012-07-19 12:23 ` paolo.carlini at oracle dot com
2012-07-19 12:34 ` redi at gcc dot gnu.org
2012-07-19 12:48 ` paolo.carlini at oracle dot com
2012-07-19 15:18 ` daniel.kruegler at googlemail dot com
2012-07-19 15:26 ` paolo.carlini at oracle dot com
2012-07-20  9:49 ` paolo at gcc dot gnu.org
2012-07-20  9:51 ` 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).