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

* [Bug c++/37906] has_trivial_default_constructor vs. deleted copy ctor
  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 ` paolo dot carlini at oracle dot com
  2008-12-04 14:48 ` jason at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: paolo dot carlini at oracle dot com @ 2008-10-24  8:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from paolo dot carlini at oracle dot com  2008-10-24 08:45 -------
Hi. This issue is really c++, because the library just forwards to the
"builtin" C++ trait. The latter in turn simply uses TYPE_HAS_TRIVIAL_DFLT, thus
seems to me similar to c++/36856, that is the appropriate fix isn't tweaking
the implementation of the traits itself, instead moving forward a bit more the
infrastructure in the C++ front-end to C++1x.  I'd like to ask Jason opinion
about this anyway: in a nutshell, do you agree that in c++0x mode,
TYPE_HAS_TRIVIAL_DFLT should just return the correct answer?


-- 

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
          Component|libstdc++                   |c++


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


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

* [Bug c++/37906] has_trivial_default_constructor vs. deleted copy ctor
  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
  3 siblings, 0 replies; 5+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-12-04 14:48 UTC (permalink / raw)
  To: gcc-bugs



-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jason at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-12-04 14:45:50
               date|                            |


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


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

* [Bug c++/37906] has_trivial_default_constructor vs. deleted copy ctor
  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
  3 siblings, 0 replies; 5+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-12-04 19:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jason at gcc dot gnu dot org  2008-12-04 19:01 -------
Subject: Bug 37906

Author: jason
Date: Thu Dec  4 19:00:03 2008
New Revision: 142442

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142442
Log:
        PR c++/37906
        * decl.c (grok_special_member_properties): Set TYPE_HAS_COMPLEX_DFLT
        here.
        * class.c (check_bases_and_members): Rather than assuming any
        user-declared default constructor is complex here.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/defaulted6.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/class.c
    trunk/gcc/cp/decl.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/37906] has_trivial_default_constructor vs. deleted copy ctor
  2008-10-24  3:17 [Bug libstdc++/37906] New: has_trivial_default_constructor vs. deleted copy ctor bkoz at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-12-04 19:03 ` jason at gcc dot gnu dot org
@ 2008-12-22  2:29 ` jason at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-12-22  2:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jason at gcc dot gnu dot org  2008-12-22 02:26 -------
Fixed.


-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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