------- Additional Comments From scott dot tupaj at line6 dot com 2005-06-21 17:01 ------- Yes, agreeably this is 'bad' c++ practice in my example. However, if wrong code is produced, I think it would be prudent for at least a compiler warning or error be produced if the reason for wrong code is because invalid or questionable c++ syntax is being used.
Every other compiler I've used, including gcc 3.x.x doesn't not corrupt access to the members in this scenario like gcc 4.0.0 does. Other compilers either error because of the const violation, or accepts it and produces the proper results when accessing the pointer. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22132