public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/37906]  New: has_trivial_default_constructor vs. deleted copy ctor
@ 2008-10-24  3:17 bkoz at gcc dot gnu dot org
  2008-10-24  8:47 ` [Bug c++/37906] " paolo dot carlini at oracle dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2008-10-24  3:17 UTC (permalink / raw)
  To: gcc-bugs

The following:


#include <type_traits>

struct b
{
  b() = default;
  b(const b&) = delete;
};

void test01()
{
  typedef b     test_type;

  // typedef std::is_standard_layout<test_type> standard_layout_p;
  typedef std::has_trivial_default_constructor<test_type> ctor_p;
  typedef std::has_trivial_destructor<test_type> dtor_p;

  // static_assert(standard_layout_p::value, "not standard_layout");
  static_assert(ctor_p::value, "default ctor not trivial");
  static_assert(dtor_p::value, "dtor not trivial");
}

Gives:

%$bld/H-x86-gcc.20081020/bin/g++ -std=gnu++0x -c standard_layout.cc
standard_layout.cc: In function 'void test01()':
standard_layout.cc:40: error: static assertion failed: "default ctor not
trivial"

Removing the copy constructor makes the error go away.


-- 
           Summary: has_trivial_default_constructor vs. deleted copy ctor
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bkoz at gcc dot gnu dot org
  GCC host triplet: all


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


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

end of thread, other threads:[~2008-12-22  2:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-24  3:17 [Bug libstdc++/37906] New: has_trivial_default_constructor vs. deleted copy ctor bkoz at gcc dot gnu dot org
2008-10-24  8:47 ` [Bug c++/37906] " paolo dot carlini at oracle dot com
2008-12-04 14:48 ` jason at gcc dot gnu dot org
2008-12-04 19:03 ` jason at gcc dot gnu dot org
2008-12-22  2:29 ` 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).