------- Additional Comments From squell at alumina dot nl 2005-07-23 16:26 ------- (In reply to comment #6) > In your example, ptr is a type not an object. operator-> isn't applicable > to types, only to objects.
ptr _is_ an object. Please re-read the declaration carefully. All gcc versions (correctly) allow this (in the reduced case): int (*fp)() = ptr->f; But in this case, the initialized expression isn't required to be a constant address expression. I think my claim that g++ rejected my original code because it rejects '->' in a constant expression is correct. The original issue should probably be downgraded in its severity. It is too obscure and there is a work-around. However, if "&obj->staticmember" is a constant address expression, then G++ should not reject it. If it is not, this is a defect in C++, not GCC. -- What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |minor http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22621