Came across a strange compiler difference today and wasn't sure which
compiler had the bug.
void AFunction( Rect &aRect )
{
if ( 1 ) {
Rect aRect = { aRect.top, aRect.left, aRect.bottom, aRect.right };
}
}
Now, granted, this is a very weird way to write things (I didn't write
code this way :-), but Microsoft Visual C++, aRect.top apparently
refers
to the aRect parameter that was passed into the function.
X-Code (which uses gcc as it's compiler) has aRect.top referring to
the aRect declared within the scope of
the if statement.
So, what does the C++ standard say?