https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114410
--- Comment #7 from Cristian VOICA ---
I've found a flag that sounds closer to my needs: -Wcast-qual
As the issue seems to me to come from the need to stay compatible with C I
think this flag does a pretty decent job to hint at the problem.
:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114410
--- Comment #6 from Cristian VOICA ---
makes sense, thx!
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114410
--- Comment #4 from Cristian VOICA ---
I'm also trying to understand another thing.
Perhaps you can point me to where to read more about it as I was not expecting
casting to a non-const reference to work for a member in a const object.
Is
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114410
--- Comment #3 from Cristian VOICA ---
be aware that is initial issue mentions "If the type of r is changed to const
int&, the program correctly compiles with GCC"
I have this in my code as well but this is not always what programmer wants as
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114410
Bug ID: 114410
Summary: compiler issue in reference_binding when using rvalue
reference to member of const object
Product: gcc
Version: 13.1.0
Status: UNCONFIRMED