[llvm-bugs] [Bug 37612] New: member pointer to base member ignores base offset when pointer is function-local and auto-typed.

via llvm-bugs llvm-bugs at lists.llvm.org
Mon May 28 07:53:44 PDT 2018


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

            Bug ID: 37612
           Summary: member pointer to base member ignores base offset when
                    pointer is function-local and auto-typed.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: xaxazak at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

Created attachment 20348
  --> https://bugs.llvm.org/attachment.cgi?id=20348&action=edit
code demonstrating bug

When a derived class's base class has a non-zero offset, a derived-class
pointer-to-member to a base-class member should include this offset. But when
the pointer-to-member is both auto-typed and defined inside a function, it
appears to ignore the base-class offset.

The attached code should produce "0" "0x4".
Clang++ produces: "0" "0".
GCC correctly produces: "0" "0x4".

I believe the base class offset is being treated as zero.

(To me, this is an unusually specific bug).


llvm/clang from trunk as of 2018/05/28, via git.

-- 
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/20180528/a8d7cfa4/attachment.html>


More information about the llvm-bugs mailing list