[Bug c++/35101] Const object creation with mutable field

tatraian at inf dot elte dot hu gcc-bugzilla@gcc.gnu.org
Wed Feb 6 13:44:00 GMT 2008



------- Comment #2 from tatraian at inf dot elte dot hu  2008-02-06 13:43 -------
The example is in the section: [expr.mptr.oper]
But, if the stadnadr code examples can contain errors maybe this is one of
them.
The whole example is the next:

struct S {
           mutable int i;
};

const S cs;
int S::* pm = &S::i;          // pm refers to mutable member S::i
cs.*pm = 88;                    // ill-formed: cs is a const object


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35101



More information about the Gcc-bugs mailing list