public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/54059] New: g++ silently omits code that creates a std::chrono::millisecond temporary
@ 2012-07-20 23:08 jason at cornsyrup dot org
  2012-07-20 23:11 ` [Bug c++/54059] " jason at cornsyrup dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jason at cornsyrup dot org @ 2012-07-20 23:08 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 54059
           Summary: g++ silently omits code that creates a
                    std::chrono::millisecond temporary
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jason@cornsyrup.org


jason@ps027 ~/bug$ g++-4.7 -std=c++11 bug.cc 
jason@ps027 ~/bug$ ./a.out 
got 100
jason@ps027 ~/bug$ cat bug.cc 

#include <chrono>
#include <iostream>

struct foo {
    foo(std::chrono::milliseconds ms) {
        std::cout << "got " << ms.count() << "\n";
    }
};

int main() {
    foo f1(std::chrono::milliseconds(100));
    unsigned int a = 200;
    foo f2(std::chrono::milliseconds(a));
    return 0;
}
jason@ps027 ~/bug$ g++-4.7 -v
Using built-in specs.
COLLECT_GCC=g++-4.7
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.7.1-4+ub1' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs
--enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.7 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7
--libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin
--enable-objc-gc --disable-werror --with-arch-32=i586 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.7.1 (Ubuntu/Linaro 4.7.1-4+ub1)


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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-20 23:08 [Bug c++/54059] New: g++ silently omits code that creates a std::chrono::millisecond temporary jason at cornsyrup dot org
2012-07-20 23:11 ` [Bug c++/54059] " jason at cornsyrup dot org
2012-07-20 23:12 ` pinskia at gcc dot gnu.org
2012-07-20 23:14 ` redi at gcc dot gnu.org
2012-07-20 23:17 ` jason at cornsyrup dot org

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).