public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/37860]  New: default and delete used w/ member functions vs. initialization
@ 2008-10-17  8:18 bkoz at gcc dot gnu dot org
  2008-10-17  8:20 ` [Bug c++/37860] " bkoz at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2008-10-17  8:18 UTC (permalink / raw)
  To: gcc-bugs

Valid C++0x code is failing to compile. Support for default and delete appears
to be incomplete, as certain valid initialization fails. An example:

struct b
{
  bool t;

  b() = default;
  ~b() = default;
  b& operator=(const b&) = delete;
  b(const b&) = delete;
};

int main()
{
  // copy initialization
  b tst1 = { false }; // valid but error

  // copy initialization. 
  b tst2 = false;

  // direct initialization, copy list initialization syntax
  b tst3 { false }; // valid but error

  // default initialization
  b tst4;
}


See tst1, tst3.

This is related to the GCC bug report about standard layout types but I'm going
to go and file individual bug reports about known issues.


-- 
           Summary: default and delete used w/ member functions vs.
                    initialization
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
        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=37860


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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-17  8:18 [Bug c++/37860] New: default and delete used w/ member functions vs. initialization bkoz at gcc dot gnu dot org
2008-10-17  8:20 ` [Bug c++/37860] " bkoz at gcc dot gnu dot org
2008-10-22 22:31 ` [Bug c++/37860] standard_layout: direct and copy initialization issues bkoz at gcc dot gnu dot org
2008-10-22 23:08 ` bkoz at gcc dot gnu dot org
2008-12-02 19:18 ` 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).