public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug c++/41421] New: [C++0x] Trivial types should require trivial default constructor. @ 2009-09-20 18:32 cadaker at gmail dot com 2009-09-20 19:11 ` [Bug c++/41421] " paolo dot carlini at oracle dot com ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: cadaker at gmail dot com @ 2009-09-20 18:32 UTC (permalink / raw) To: gcc-bugs The C++0x standard draft defines a trivial type as one that has trivial default construct, copy constructor, copy assignment operator and destructor. g++ from the current trunk, however, classifies types without default constructor as trivial, meaning that the following code does not compile: #include <type_traits> struct Foo { Foo(int) {} }; static_assert(!std::is_trivial<Foo>::value, "Not trivial - no (trivial) default constructor."); This seems like a bug (unless I've misunderstood the draft or missed some pending change to it). -- Summary: [C++0x] Trivial types should require trivial default constructor. Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: minor Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: cadaker at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41421 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/41421] [C++0x] Trivial types should require trivial default constructor. 2009-09-20 18:32 [Bug c++/41421] New: [C++0x] Trivial types should require trivial default constructor cadaker at gmail dot com @ 2009-09-20 19:11 ` paolo dot carlini at oracle dot com 2009-09-21 16:11 ` jason at gcc dot gnu dot org 2009-09-21 16:30 ` jason at gcc dot gnu dot org 2 siblings, 0 replies; 4+ messages in thread From: paolo dot carlini at oracle dot com @ 2009-09-20 19:11 UTC (permalink / raw) To: gcc-bugs ------- Comment #1 from paolo dot carlini at oracle dot com 2009-09-20 19:11 ------- Jason, can you have a look to this issue? I believe submitter is right. Should we use TYPE_HAS_TRIVIAL_DFLT instead? Note sure about TYPE_HAS_TRIVIAL_INIT_REF, TYPE_HAS_TRIVIAL_ASSIGN_REF, and TYPE_HAS_TRIVIAL_DESTRUCTOR. Humm, maybe just "reversing" the logic in trivial_type_p is enough?!? -- paolo dot carlini at oracle dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paolo dot carlini at oracle | |dot com, jason at gcc dot | |gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41421 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/41421] [C++0x] Trivial types should require trivial default constructor. 2009-09-20 18:32 [Bug c++/41421] New: [C++0x] Trivial types should require trivial default constructor cadaker at gmail dot com 2009-09-20 19:11 ` [Bug c++/41421] " paolo dot carlini at oracle dot com @ 2009-09-21 16:11 ` jason at gcc dot gnu dot org 2009-09-21 16:30 ` jason at gcc dot gnu dot org 2 siblings, 0 replies; 4+ messages in thread From: jason at gcc dot gnu dot org @ 2009-09-21 16:11 UTC (permalink / raw) To: gcc-bugs ------- Comment #2 from jason at gcc dot gnu dot org 2009-09-21 16:11 ------- Subject: Bug 41421 Author: jason Date: Mon Sep 21 16:11:26 2009 New Revision: 151932 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=151932 Log: PR c++/41421 * tree.c (trivial_type_p): Fix logic. Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/tree.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/g++.dg/cpp0x/trivial1.C -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41421 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/41421] [C++0x] Trivial types should require trivial default constructor. 2009-09-20 18:32 [Bug c++/41421] New: [C++0x] Trivial types should require trivial default constructor cadaker at gmail dot com 2009-09-20 19:11 ` [Bug c++/41421] " paolo dot carlini at oracle dot com 2009-09-21 16:11 ` jason at gcc dot gnu dot org @ 2009-09-21 16:30 ` jason at gcc dot gnu dot org 2 siblings, 0 replies; 4+ messages in thread From: jason at gcc dot gnu dot org @ 2009-09-21 16:30 UTC (permalink / raw) To: gcc-bugs ------- Comment #3 from jason at gcc dot gnu dot org 2009-09-21 16:30 ------- Fixed, thanks. -- jason at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41421 ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-09-21 16:30 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2009-09-20 18:32 [Bug c++/41421] New: [C++0x] Trivial types should require trivial default constructor cadaker at gmail dot com 2009-09-20 19:11 ` [Bug c++/41421] " paolo dot carlini at oracle dot com 2009-09-21 16:11 ` jason at gcc dot gnu dot org 2009-09-21 16:30 ` jason at gcc dot gnu 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).