This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/37860] New: default and delete used w/ member functions vs. initialization
- From: "bkoz at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Oct 2008 08:17:15 -0000
- Subject: [Bug c++/37860] New: default and delete used w/ member functions vs. initialization
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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