Skip to content

for loop variable scope #11696

@llvmbot

Description

@llvmbot
Bugzilla Link 11324
Resolution INVALID
Resolved on Nov 07, 2011 17:45
Version 2.7
OS Linux
Reporter LLVM Bugzilla Contributor
CC @DougGregor

Extended Description

the second "i" in

for (int i = 0; i < 10; ++i) {
const int i = -1;
...
}

is flagged as redefinition error, while imho it should be regarded as equivalent to standard shadowing:

int i = 0;
{
const int i = -1;
...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++invalidResolved as invalid, i.e. not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions