Originally Posted by
CornedBee
8.5 is the relevant standard section. I was inaccurate in my wording above. The accurate but simplified version is this:
default-initialization: For non-PODs, call the default constructor (if any). For PODs, zero-initialize.
zero-initialize: For simple variables, set to 0. For aggregates, recursively zero-initialize all members. For non-PODs, set the underlying storage to all 0s.
T(): Default-initialize.
T t;: For non-primitives, default-initialize. For primitives, don't initialize at all.
Note: T t(); declares a function.
In addition, all static duration variables (globals, class statics, function statics) are zero-initialized before anything else is done.
Does that clear everything up?