------- Comment #3 from redi at gcc dot gnu dot org 2010-03-30 09:16 ------- (In reply to comment #2) > is it still invalid in c++0X ?
Yes. > 5.3.4.15 has been revamped, and I no longer find a motif to reject such code. In C++0x the object is default-initialized, which for a class type means the default constructor is called. In this code, the default constructor is deleted, so the code will not compile. See 12.1/5 > I think the following code is also invalid, according to 8.5.6 (c++03) / 8.5.8 > (c++0x): > > struct A { int& i; }; > void f () { new A; } Not quite: in C++0x the program doesn't call for default-initialization of A::i, it calls for default-initialization of A, which is invalid because the default constructor is deleted. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25811