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