All even remotely relevant GCC and Clang versions support this
attribute. The test is useful to detect support in compilers that
don't define __GNUC__ or __clang__, for example, Solaris Studio.
This matches the modified m4/ax_gcc_func_attribute.m4.
Only constructor and ifunc attribute checks were implemented.
CMake-based build doesn't have the trouble of Autoconf confdefs.h
but writing warning-free tests would still some extra care.
If looking for attribute-related warnings works well enough then
this method should be nicer than the -Werror method in CMake too.