Page MenuHomeFeedback Tracker

Variable declarations are not scoped to the inner code block if the code block is not the body of a control flow construct.
New, NormalPublic

Description

For example:
"
if(1)
{
int i = 0;
}
if(1)
{
int i = 0;
}
"
is a valid code sequence, but:
"
{
int j = 0;
}
{
int j = 0;
}
" Is invalid due to 'multiple declarations' of j.
This is annoying.

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 7
Category
General
Steps To Reproduce

Already described in description.

Event Timeline