public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/35782]  New: support for standard layout types
@ 2008-04-01  0:15 bkoz at gcc dot gnu dot org
  2008-04-01  4:06 ` [Bug c++/35782] " bkoz at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2008-04-01  0:15 UTC (permalink / raw)
  To: gcc-bugs

This is an enhancement request for a C++0x feature, standard layout type. This
is a relaxation of POD, and allows things like member functions.

This is necessary to correctly implement 29_atomics.

See:
"Modification to the definition of plain old data"
http://en.wikipedia.org/wiki/C%2B%2B0x

or

POD's Revisited
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2342.htm


-- 
           Summary: support for standard layout types
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bkoz at gcc dot gnu dot org


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


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

* [Bug c++/35782] support for standard layout types
  2008-04-01  0:15 [Bug c++/35782] New: support for standard layout types bkoz at gcc dot gnu dot org
@ 2008-04-01  4:06 ` bkoz at gcc dot gnu dot org
  2008-04-01 19:20 ` rguenth at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2008-04-01  4:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from bkoz at gcc dot gnu dot org  2008-04-01 04:05 -------

struct b
{
  bool t;

#if 1
  // need standard layout relaxation from POD
private:
  b& operator=(const b&);
  b(const b&);
#endif
};

int main()
{
  b tst1 = { false };
  const b tst2 = { true };
 return 0;
}


-- 


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


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

* [Bug c++/35782] support for standard layout types
  2008-04-01  0:15 [Bug c++/35782] New: support for standard layout types bkoz at gcc dot gnu dot org
  2008-04-01  4:06 ` [Bug c++/35782] " bkoz at gcc dot gnu dot org
@ 2008-04-01 19:20 ` rguenth at gcc dot gnu dot org
  2008-09-10  1:46 ` bkoz at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-04-01 19:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2008-04-01 19:20 -------
Confirmed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-04-01 19:20:05
               date|                            |


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


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

* [Bug c++/35782] support for standard layout types
  2008-04-01  0:15 [Bug c++/35782] New: support for standard layout types bkoz at gcc dot gnu dot org
  2008-04-01  4:06 ` [Bug c++/35782] " bkoz at gcc dot gnu dot org
  2008-04-01 19:20 ` rguenth at gcc dot gnu dot org
@ 2008-09-10  1:46 ` bkoz at gcc dot gnu dot org
  2008-09-10  1:48 ` bkoz at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2008-09-10  1:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from bkoz at gcc dot gnu dot org  2008-09-10 01:45 -------

Specifically the qualities that I am looking for are:

1) be able to inherit from "C" POD and be standard layout
2) be able to have deleted ctor/copy ctor and be standard layout
3) able to do aggregate init when 1, 2


-- 


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


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

* [Bug c++/35782] support for standard layout types
  2008-04-01  0:15 [Bug c++/35782] New: support for standard layout types bkoz at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-09-10  1:46 ` bkoz at gcc dot gnu dot org
@ 2008-09-10  1:48 ` bkoz at gcc dot gnu dot org
  2008-09-10  3:39 ` jason at redhat dot com
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2008-09-10  1:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from bkoz at gcc dot gnu dot org  2008-09-10 01:47 -------
Created an attachment (id=16268)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16268&action=view)
atomics with deleter functions


Would also like to inherit instead of encapsulate, but will cross that bridge
when the rest of the bits are settled...


-- 


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


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

* [Bug c++/35782] support for standard layout types
  2008-04-01  0:15 [Bug c++/35782] New: support for standard layout types bkoz at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-09-10  1:48 ` bkoz at gcc dot gnu dot org
@ 2008-09-10  3:39 ` jason at redhat dot com
  2008-09-10 21:48 ` bkoz at redhat dot com
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jason at redhat dot com @ 2008-09-10  3:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jason at redhat dot com  2008-09-10 03:37 -------
Subject: Re:  support for standard layout types

bkoz at gcc dot gnu dot org wrote:
> Specifically the qualities that I am looking for are:
> 
> 1) be able to inherit from "C" POD and be standard layout
> 2) be able to have deleted ctor/copy ctor and be standard layout
> 3) able to do aggregate init when 1, 2

You can't have 2 and 3 under the current working paper.

http://home.twcny.rr.com/hinnant/cpp_extensions/issues_preview/lwg-active.html#845


-- 


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


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

* [Bug c++/35782] support for standard layout types
  2008-04-01  0:15 [Bug c++/35782] New: support for standard layout types bkoz at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-09-10  3:39 ` jason at redhat dot com
@ 2008-09-10 21:48 ` bkoz at redhat dot com
  2008-09-17 21:18 ` jason at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: bkoz at redhat dot com @ 2008-09-10 21:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from bkoz at redhat dot com  2008-09-10 21:46 -------
Subject: Re:  support for standard layout types


> > 1) be able to inherit from "C" POD and be standard layout
> > 2) be able to have deleted ctor/copy ctor and be standard layout
> > 3) able to do aggregate init when 1, 2
> 
> You can't have 2 and 3 under the current working paper.
> 
> http://home.twcny.rr.com/hinnant/cpp_extensions/issues_preview/lwg-active.html#845

Ah ha. Thanks.

-benjamin


-- 


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


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

* [Bug c++/35782] support for standard layout types
  2008-04-01  0:15 [Bug c++/35782] New: support for standard layout types bkoz at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2008-09-10 21:48 ` bkoz at redhat dot com
@ 2008-09-17 21:18 ` jason at gcc dot gnu dot org
  2008-09-18 17:03 ` jason at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-09-17 21:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jason at gcc dot gnu dot org  2008-09-17 21:17 -------
8.5.1 says "An aggregate is an array or a class (Clause 9) with ... no base
classes (Clause 10)...."

Lawrence's suggestion won't work because the copy constructor is deleted.  To
make aggregate initialization work, we need to expand the definition of
aggregate to include classes with user-provided constructors that are all
deleted.


-- 


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


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

* [Bug c++/35782] support for standard layout types
  2008-04-01  0:15 [Bug c++/35782] New: support for standard layout types bkoz at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2008-09-17 21:18 ` jason at gcc dot gnu dot org
@ 2008-09-18 17:03 ` jason at gcc dot gnu dot org
  2008-12-02 19:18 ` jason at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-09-18 17:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jason at gcc dot gnu dot org  2008-09-18 17:01 -------
(In reply to comment #7)
> Lawrence's suggestion won't work because the copy constructor is deleted.

It seems I was wrong about this: the wording that went into the standard
doesn't require the copy for copy-list-initialization.  Guess I need to fix the
compiler.


-- 


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


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

* [Bug c++/35782] support for standard layout types
  2008-04-01  0:15 [Bug c++/35782] New: support for standard layout types bkoz at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2008-09-18 17:03 ` jason at gcc dot gnu dot org
@ 2008-12-02 19:18 ` jason at gcc dot gnu dot org
  2008-12-02 23:55 ` jason at gcc dot gnu dot org
  2008-12-02 23:59 ` jason at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-12-02 19:18 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|NEW                         |ASSIGNED
   Last reconfirmed|2008-04-01 19:20:05         |2008-12-02 19:13:07
               date|                            |


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


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

* [Bug c++/35782] support for standard layout types
  2008-04-01  0:15 [Bug c++/35782] New: support for standard layout types bkoz at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2008-12-02 19:18 ` jason at gcc dot gnu dot org
@ 2008-12-02 23:55 ` jason at gcc dot gnu dot org
  2008-12-02 23:59 ` jason at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-12-02 23:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from jason at gcc dot gnu dot org  2008-12-02 23:53 -------
Subject: Bug 35782

Author: jason
Date: Tue Dec  2 23:52:02 2008
New Revision: 142379

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142379
Log:
        PR c++/35782, c++/37860
        * call.c (build_user_type_conversion_1): Remember
        list-initialization.
        (convert_like_real): Likewise.
        (build_over_call): Don't require the copy constructor
        for copy-list-initialization.
        * cp-tree.h (TARGET_EXPR_LIST_INIT_P): New macro.

        PR c++/37234
        * decl.c (cp_finish_decl): Handle =default and =delete for
        templates, too.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/defaulted5.C
    trunk/gcc/testsuite/g++.dg/cpp0x/initlist9.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/call.c
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/decl.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/35782] support for standard layout types
  2008-04-01  0:15 [Bug c++/35782] New: support for standard layout types bkoz at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2008-12-02 23:55 ` jason at gcc dot gnu dot org
@ 2008-12-02 23:59 ` jason at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-12-02 23:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from jason at gcc dot gnu dot org  2008-12-02 23:53 -------
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=35782


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

end of thread, other threads:[~2008-12-02 23:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-01  0:15 [Bug c++/35782] New: support for standard layout types bkoz at gcc dot gnu dot org
2008-04-01  4:06 ` [Bug c++/35782] " bkoz at gcc dot gnu dot org
2008-04-01 19:20 ` rguenth at gcc dot gnu dot org
2008-09-10  1:46 ` bkoz at gcc dot gnu dot org
2008-09-10  1:48 ` bkoz at gcc dot gnu dot org
2008-09-10  3:39 ` jason at redhat dot com
2008-09-10 21:48 ` bkoz at redhat dot com
2008-09-17 21:18 ` jason at gcc dot gnu dot org
2008-09-18 17:03 ` jason at gcc dot gnu dot org
2008-12-02 19:18 ` jason at gcc dot gnu dot org
2008-12-02 23:55 ` jason at gcc dot gnu dot org
2008-12-02 23:59 ` 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).