| 1 |
// P0466R5 |
| 2 |
// { dg-do compile { target c++20 } } |
| 3 |
|
| 4 |
namespace std |
| 5 |
{ |
| 6 |
template <class S, class M> |
| 7 |
constexpr bool |
| 8 |
is_pointer_interconvertible_with_class (M S::*m) noexcept |
| 9 |
{ |
| 10 |
return __builtin_is_pointer_interconvertible_with_class (m); |
| 11 |
} |
| 12 |
} |
| 13 |
|
| 14 |
struct A { int a; }; |
| 15 |
|
| 16 |
double A::*a = nullptr; |
| 17 |
constexpr double A::*b = nullptr; |
| 18 |
constexpr auto c = std::is_pointer_interconvertible_with_class (a); // { dg-error "is not usable in a constant expression" } |
| 19 |
constexpr auto d = std::is_pointer_interconvertible_with_class (b); |