[PATCH] [libcxx] Use __decltype instead of __typeof__

Eric Fiselier eric at efcs.ca
Tue Jun 16 09:05:07 PDT 2015


================
Comment at: include/__config:585-591
@@ +584,9 @@
+# endif
+// Clang 3.0 and GCC 4.6 provide __decltype in all standard modes.
+// XCode 5.0 is based off of Clang 3.3 SVN. We require Clang 3.3
+// be sure we have __decltype.
+#if (defined(__apple_build_version__) && _CLANG_VER >= 500) || \
+    (!defined(__apple_build_version__) && _CLANG_VER >= 303) || \
+    _GNUC_VER >= 406
+#  define decltype(__x) __decltype(__x)
+#else
----------------
rsmith wrote:
> You can use `__is_identifier` for this. Clang's supported it since r206069 (version 3.5), which may be good enough? (How old a Clang release can still parse libc++?)
> You can use __is_identifier for this. Clang's supported it since r206069 (version 3.5), which may be good enough?

Unless @mclow.lists has any objection to this I would like to change this to use `__is_identifier`. While 3.5 might be artificially limiting it seems like the safest and cleanest way to detect `__decltype`. I'm not super happy jumping through hoops to support old compilers with new libc++ headers.

> How old a Clang release can still parse libc++?

I'm currently working on a proposal to define (and hopefully limit) the compilers which ToT libc++ supports. I'll have an answer to this question soon.

http://reviews.llvm.org/D10426

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list