<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - constexpr pointer to data member conversion issue"
href="https://bugs.llvm.org/show_bug.cgi?id=42366">bug 42366</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>NEW
</td>
<td>RESOLVED
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>INVALID
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - constexpr pointer to data member conversion issue"
href="https://bugs.llvm.org/show_bug.cgi?id=42366#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - constexpr pointer to data member conversion issue"
href="https://bugs.llvm.org/show_bug.cgi?id=42366">bug 42366</a>
from <span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span></b>
<pre>The stackoverflow answer quotes the relevant wording:
"""
A prvalue of type “pointer to member of D of type cv1 T” can be converted to a
prvalue of type “pointer to member of B of type cv2 T”, where B is a base class
of D, if cv2 is the same cv-qualification as, or greater cv-qualification than,
cv1. […] If class B contains the original member, or is a base or derived class
of the class containing the original member, the resulting pointer to member
points to the original member. Otherwise, the behavior is undefined.
"""
Here, D is Derived and B is Base. The original member is Data::foo. B does not
contain Data::foo, and is neither a base or derived class of the class
containing the original member (Data), so behavior is undefined, so the
evaluation is non-constant.</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>