[llvm-bugs] [Bug 24994] New: Wrong value when evaluating a shadowed global inside the namespace

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 29 17:41:35 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=24994

            Bug ID: 24994
           Summary: Wrong value when evaluating a shadowed global inside
                    the namespace
           Product: lldb
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: dawn+bugzilla at burble.org
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

If a global identifier is over shadowed in a namespace, evaluating the global
inside the namespace returns the value of the identifier in the namespace, not
the global. See comments in the following test case.  This started with lldb
r247746.  (Note: test case was tested with clang based on svn 3.4, 3.6 and
trunk on OSX).

    #include <stdio.h>
    int make_used;
    static int ScNSpacGl = 2100;
    namespace NS2 {
        static int ScNSpacGl = 2111;
        static void NS2Func(void) {
            // Set BP here, eval ::ScNSpacGl, Exp: 2100 Act: 2111
            printf("eval @BP line=%d: ::ScNSpacGl = %d\n", __LINE__,
::ScNSpacGl);
            make_used += ScNSpacGl;
        }
    }
    int main(int argc, char **argv) {
        NS2::NS2Func();
        return make_used == 0;
    }

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150930/19769c73/attachment.html>


More information about the llvm-bugs mailing list