On Apr 28, 2011, at 3:57 PM, Argyrios Kyrtzidis wrote:

> Author: akirtzidis
> Date: Thu Apr 28 17:57:55 2011
> New Revision: 130453
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=130453&view=rev
> Log:
> Cut down unnecessary zero'ing when value-initializing arrays of C++ objects.
> 
> -C++ objects with user-declared constructor don't need zero'ing.

Are you sure that this is true?  Apparently the C++ standard requires that 
global variables (at least) are zero initialized and that constructors can take 
advantage of this.  This is apparently well defined:

struct foo {
 int x;

 foo() { 
   ++x;
 }
} f;

I'm pretty sure that this doesn't apply to temporaries etc, but it would be 
worth checking if you haven't already.

-Chris
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to