2 // { dg-do run { target c++23 } }
4 // conversion of the implicit object argument to an xobj parameter
5 // using a user defined conversion or converting constructor
6 // when calling by value xobj member functions
8 // see explicit-obj-by-value1.C for details on this test
10 using uintptr_t = __UINTPTR_TYPE__;
11 inline constexpr uintptr_t magic = 42;
21 operator uintptr_t() const {
24 uintptr_t f(this uintptr_t n) {
27 uintptr_t g(this FromS from_s) {
32 FromS::FromS(S) : _v(magic) {}
39 // prevent (absurdly improbable) bogus failures
40 S& s = magic != (uintptr_t)(&s0) ? s0 : s1;
42 uintptr_t const ret0 = s.f();
43 // check for reinterpretation of the object argument
44 if (ret0 == (uintptr_t)(&s))
46 // check for a bugged conversion
50 uintptr_t const ret1 = s.g();
51 // check for reinterpretation of the object argument
52 if (ret1 == (uintptr_t)(&s))
54 // check for a bugged conversion