weakref attribute detection broken with gcc 4.6 and higher