Yesterday, I found myself writing code like this:
SomeStruct getSomeStruct()
{
SomeStruct input;
cin >> input.x;
cin >> input.y;
}
<
You didn't get any warning because you didn't have -Wall -Werror
turned on. (As stated in other answers)
However I think you probably got a zero-filled struct as the result because the stack object was default constructed in the caller function, possibly with explicit zero arguments, or else due to zeros on the stack?