[Bug c++/79687] [5/6/7 Regression] Wrong code with pointer-to-member

reichelt at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Feb 24 09:34:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79687

--- Comment #19 from Volker Reichelt <reichelt at gcc dot gnu.org> ---
No, that's again invalid.
The second operand of .* or .-> must point to a valid class member,
otherwise you'll get undefined behavior.
The only way to achieve this in this class with a single member is to
initialize it with &A::c (or a copy of this value).


More information about the Gcc-bugs mailing list