This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55082] New: c++11: default member constructor
- From: "lisp2d at lisp2d dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 26 Oct 2012 14:52:13 +0000
- Subject: [Bug c++/55082] New: c++11: default member constructor
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55082
Bug #: 55082
Summary: c++11: default member constructor
Classification: Unclassified
Product: gcc
Version: 4.7.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: lisp2d@lisp2d.net
In class definition default constructor for elements works only
by using {} notation.
Operator = is not allowed.
bug.cpp:
class A{
int a{0}; // works
int b = 0; // works
public:
explicit A(int x):a(x),b(x){}
};
class B{
A a{0}; // works
A b = 0; // error: trying to use operator=
public:
explicit B(int x):a(x),b(x){}
};
int main(int,char**){
B b(1);
return 0;}