That 'casting away constness' bug? Recent changes caused it to turn into a failure-to-compile bug on gcc. (Sometimes the compiler believes you if you tell it that something is const....)
I fixed it. The function returns a non-const value now. In addition, a section of code is restructured to use a modifiable lvalue rather than an rvalue. Patch is attached. (edit: compiles and runs.)
You can forget this patch as the compilation failure was fixed another way. :-)