c++: P0847R7 (deducing this) - xobj lambdas. [PR102609]
[official-gcc.git] / gcc / testsuite / g++.dg / cpp2a / is-pointer-interconvertible-with-class6.C
blob4b6801c41da61ebfdac1222e4671b59b6e42a5a2
1 // P0466R5
2 // { dg-do compile { target c++20 } }
4 namespace std
6 template <class S, class M>
7 constexpr bool
8 is_pointer_interconvertible_with_class (M S::*m) noexcept
10   return __builtin_is_pointer_interconvertible_with_class (m);
14 struct A { int a; };
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);