Hi Karlos
A specialist in finding GNU bugs, huh? ;-)
I belive you're right and that should be accepted.
However I think I understand the reason why this behaves like so.
In C++ to C metacode conversion for methods you could imagine an additional argument:
void C::Method( ... ); -> void C_Metchod( C *this, ... );
And for inspectors (I was at important talk recently and someone was checking my knowledge and asked me about this and I didn't know the name...) this changes into:
coid C::Inspect( ... ) const; -> void C_Inspect( const C *this, ... );
The reason for this behaviour can be that your method is inlined and then compiler discovers that 'this' is not used, so it removes it completely. If it does not exist it cannot be const.
However, like you, I think this is not correct reaction.
My last conclusion is that your method is actually static function and its best declaration would be:
static int getInstanceCount() { return instances; }
as 'this' is really not needed here.
And I've met this already somewhere that static methods cannot be declared as inspectors - I belive its because of the above reason.
On the other hand this mayby should be accepted also?
Cheers