This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/25811] No failure creating a POD containing a const member, using new without a new-initializer.



------- Comment #8 from redi at gcc dot gnu dot org  2010-03-31 08:55 -------
(N.B. your email to gcc-patches gives the wrong PR number in the subject.)

This reject the following valid program:

struct X {
  X() : c(0), r(c) {}
  const int c;
  int const& r;
};

int main()
{
  new X;
}

If there is a default constructor it will be called, and so the members will
not be uninitialized.


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]