[LLVMbugs] [Bug 11324] New: for loop variable scope

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Nov 7 04:39:21 PST 2011


http://llvm.org/bugs/show_bug.cgi?id=11324

             Bug #: 11324
           Summary: for loop variable scope
           Product: clang
           Version: 2.7
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: darko.veberic at ung.si
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


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;
  ...
}

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list