Consider the code
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
struct B
{
public:
void f() { for (auto &v : member) { std::cout << v << std::endl; } }
private:
int member[100];
};
int main()
{
B b{};
b.f();
}
I think this code is guided by $8.5.4/3
List-initialization of an object or reference of type T is defined as follows: — If the initializer list has no elements and T is a class type with a default constructor, the object is value-initialized.
Instead the VS2013 compiler emits all 0xCCCCCCCC implying that it is leaving all elements of b.member as uninitialized. So, it appears it is performing default initialization instead of value initialization.
Please let me know if I am missing something.