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

             Bug #: 12293
           Summary: Rejects valid shadowing of a for-range-declaration
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++0x
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


There appears to be nothing in the spec that forbids this:

    int a[] = { 1, 2 };
    for(int b : a) {
      int b;
    }

While for normal for-loops, their for-range-declaration is in the same
declarative region as names declared by the loop condition, which in turn is in
the same declarative region as all declarations in the outermost block of the
loop, I find no such thing for range-based for loops. 

Clang follows GCC and rejects this testcase, but both are not
Standards-conforming if they behave this way and the spec allows such code.

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to