This note in the gets manpage looks relevant:
ISO C11 removes the specification of gets() from the C language, and since version 2.16, glibc header files don’t expose the function declaration if the
_ISOC11_SOURCEfeature test macro is defined.
Probably should be
#if !_ISOC11_SOURCE
using ::gets;
#endif