https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69410
--- Comment #9 from Zopolis0 <creatorsmithmdt at gmail dot com> --- While doing unrelated bisecting, I have tracked down the actual source of the issue to c74e6f7cfd7a741fc0477fe3660eec57581b22c5 with significant confidence. It worked fine in gcc11 when the code checked for is_friend, and does not in gcc12 when it checks for hiding, and thats the only part of that code that changed between 11 and 12.