[LLVMbugs] [Bug 15713] New: Implement MSVC's language extension to form pointers to members of virtual bases

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Apr 9 13:01:02 PDT 2013


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

            Bug ID: 15713
           Summary: Implement MSVC's language extension to form pointers
                    to members of virtual bases
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: reid.kleckner at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Clang currently rejects this program, as the standard says it is ill-formed in
[conv.mem], I think:

struct A { int a; };
struct B : virtual A { int b; };
int B::*memptr_b = &B::a;  // error
----
memptr_data_virtual.cpp:8:20: error: conversion from pointer to member of class
'A' to pointer to member of class 'B' via virtual base 'A' is not allowed
int B::*memptr_b = &B::a;  // error

MSVC accepts this program, and has a whole bunch of machinery baked into the
ABI to support it.  Data member pointers can be formed with up to 3 (!) i32s.

There's basically no way to implement this within the Itanium ABI since data
memptrs there are always just one offset, so this would only be in
-fms-compatibility (or -fms-extensions, I forget which is which).

Mostly I'm just filing this to have a discussion of record with a decision to
implement or not.  We should document this as part of
http://clang.llvm.org/compatibility.html, probably.

-- 
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/20130409/dc5ca6c5/attachment.html>


More information about the llvm-bugs mailing list