[cfe-commits] r91548 - in /cfe/trunk: include/clang/AST/ExprCXX.h lib/AST/ExprCXX.cpp lib/CodeGen/CGCXX.cpp lib/CodeGen/CGExprAgg.cpp lib/Frontend/PCHReaderStmt.cpp lib/Frontend/PCHWriterStmt.cpp lib/Sema/Sema.h lib/Sema/SemaDeclCXX.cpp lib/Sema/SemaInit.cpp test/CodeGenCXX/value-init.cpp test/SemaCXX/dcl_init_aggr.cpp

Chris Lattner clattner at apple.com
Wed Dec 16 16:21:19 PST 2009


On Dec 16, 2009, at 10:50 AM, Douglas Gregor wrote:

> Author: dgregor
> Date: Wed Dec 16 12:50:27 2009
> New Revision: 91548
>
> URL: http://llvm.org/viewvc/llvm-project?rev=91548&view=rev
> Log:
> When value-initializing a class with no user-defined constructors but
> with a non-trivial default constructor, zero-initialize the storage
> and then call the default constructor. Fixes PR5800.

Is this really required?  My understanding was that the only case in C+ 
+'98 when an unconstructed object is guaranteed to zero filled is in  
the global variable case.  Is this true in general, and if not, why  
pay the performance cost to do the zero fill?

-Chris



More information about the cfe-commits mailing list