[LLVMbugs] [Bug 12029] New: Incorrect error: reference to local variable 'BAR' declared in enclosing function

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Feb 17 13:30:22 PST 2012


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

             Bug #: 12029
           Summary: Incorrect error: reference to local variable 'BAR'
                    declared in enclosing function
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: drivehappy at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 8073
  --> http://llvm.org/bugs/attachment.cgi?id=8073
Code that fails under trunk.

Attached the test code.

Receive the following error which I believe is incorrect (under trunk):

clang_bug0.cpp:5:20: error: reference to local variable 'BAR' declared in
enclosing
      function 'main'
                unsigned char U1[BAR];
                                 ^
clang_bug0.cpp:2:21: note: 'BAR' declared here
        const unsigned int BAR = 0;


This test code compiles fine under g++, msvc, and clang2.9.

-- 
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