<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Implement MSVC's language extension to form pointers to members of virtual bases"
href="http://llvm.org/bugs/show_bug.cgi?id=15713">15713</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Implement MSVC's language extension to form pointers to members of virtual bases
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>reid.kleckner@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>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
<a href="http://clang.llvm.org/compatibility.html">http://clang.llvm.org/compatibility.html</a>, probably.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>