Index: include/__config =================================================================== --- include/__config +++ include/__config @@ -21,6 +21,12 @@ #define _GNUC_VER 0 #endif +#ifdef __clang__ +#define _CLANG_VER (__clang_major__ * 100 + __clang_minor__) +#else +#define _CLANG_VER 0 +#endif + #if !_WIN32 #include #endif @@ -577,7 +583,11 @@ #endif // _LIBCPP_HAS_NO_STATIC_ASSERT #ifdef _LIBCPP_HAS_NO_DECLTYPE -#define decltype(x) __typeof__(x) +# if _CLANG_VER >= 304 || _GNUC_VER >= 406 +# define decltype(__x) __decltype(__x) +# else +# define decltype(__x) __typeof__(__x) +# endif #endif #ifdef _LIBCPP_HAS_NO_CONSTEXPR