Created on 2025-11-25.00:00:00 last changed 1 week ago
Possible resolution:
Change in 7.2.2 [expr.type] bullet 3.7 and 3.8 as follows:
- ...
- if T1 is “pointer to member of C1 of type
cv1 UU1” and T2 is “pointer to member of C2 of typecv2 UU2”, forsome non-function type Usimilar types U1 and U2, where C1 is reference-related to C2 or C2 is reference-related to C1(9.5.4 [dcl.init.ref]), the qualification-combined type of T2 and T1 or the qualification-combined type of T1 and T2, respectively;- if T1 and T2 are similar types (7.3.6 [conv.qual]), the qualification-combined type of T1 and T2;
- ...
(From submission #822.)
There is a specification gap for "composite pointer type" in the case where both a qualification conversion and a pointer-to-member conversion is needed to achieve a common type. For example:
using P = int*;
using CP = const int* const;
struct B {
P a;
};
struct D : B {};
constexpr P (B::*bnc) = &B::a;
constexpr CP (B::*bc) = &B::a;
constexpr P (D::*dnc) = &B::a;
constexpr CP (D::*dc) = dnc; // work around GCC bug
static_assert(bnc == dc);
static_assert(bc == dnc); // EDG rejects
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2025-11-29 09:45:44 | admin | set | messages: + msg8423 |
| 2025-11-25 00:00:00 | admin | create | |