Add support for GCC's '__auto_type' extension.
As per the GCC manual: https://gcc.gnu.org/onlinedocs/gcc/Typeof.html
Implemented in GCC 4.9, __auto_type is similar to C++11 auto but works in C.
The most compelling use case is for macros; the above manual page explains the
need pretty well, so I won't repeat it here.
This implementation differs from GCC's in also supporting __auto_type in C++,
treating it the same as auto. I don't see any good reason not to, because
otherwise headers intended to be used from both languages can't use it (you
could use a define that expands to __auto_type or auto depending on the
language, but then C++ pre-11 is broken). However, for sanity's sake, it
prevents using __auto_type instead of auto with C++11+-specific functionality
such as decltype(auto), auto arguments to lambdas, and auto before a trailing
return type.
It also differs by allowing the following (by default, due to reusing the C++
auto behavior) which GCC rejects: using __auto_type * and the like, and
declaring multiple variables in one statement. It doesn't seem generally
harmful to allow them, although it increases the risk of accidental
incompatibility.
Please use enum class here; we don't use enum struct anywhere in Clang or LLVM.