[Bug c++/126599] [reflection] display_string_of(nullptr-pointer-to-data-member) is "-1"

"ivan.lazaric.gcc at gmail dot com via Gcc-bugs" <[email protected]> Tue, 04 Aug 2026 11:38:33 +0000
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D126599

--- Comment #4 from Ivan Lazaric <ivan.lazaric.gcc at gmail dot com> ---
Noting an example of similar nature (haven't run it over your patch):
```cpp
struct S { int s, t; };
struct T : S {};
template <auto M>
void foo (int);
void
bar ()
{
  foo <(int T::*)&T::s> ();
  foo <(int T::*)&T::t> ();
}
```

```
<source>:8:25: error: no matching function for call to 'foo<((0 =3D=3D -1) =
? ((long
int)0) : (((long int)0) + 0))>()'
<source>:9:25: error: no matching function for call to 'foo<((4 =3D=3D -1) =
? ((long
int)4) : (((long int)4) + 0))>()'
```

https://godbolt.org/z/EWTedKsEh

Might be more appropriate to spin it off into a separate issue though=