aboutsummaryrefslogtreecommitdiff
path: root/contrib/libc++
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-01-23 23:20:00 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-01-23 23:20:00 +0000
commitb1c1e77a8776bed9caa54293dfc412e1549ff885 (patch)
tree17d8d0bcd37b428e569925d12c77c14d787c3909 /contrib/libc++
parentf23c525c9b6af678a692a83e7627a11489eb8157 (diff)
downloadsrc-b1c1e77a8776bed9caa54293dfc412e1549ff885.tar.gz
src-b1c1e77a8776bed9caa54293dfc412e1549ff885.zip
Pull in r292833 from upstream libc++ trunk (by Eric Fiselier):
Manually force the use of __decltype in C++03 with Clang 3.4. <string> uses `decltype` in a way incompatible with `__typeof__`. This is problematic when compiling <string> with Clang 3.4 because even though it provides `__decltype` libc++ still used `__typeof__` because clang 3.4 doesn't provide __is_identifier which libc++ uses to detect __decltype. This patch manually detects Clang 3.4 and properly configures for it. This allows the graphics/openshadinglanguage port to build with lang/clang34. PR: 216054
Notes
Notes: svn path=/projects/clang400-import/; revision=312675
Diffstat (limited to 'contrib/libc++')
-rw-r--r--contrib/libc++/include/__config9
1 files changed, 8 insertions, 1 deletions
diff --git a/contrib/libc++/include/__config b/contrib/libc++/include/__config
index 973f13bc9394..9b9c69f0d134 100644
--- a/contrib/libc++/include/__config
+++ b/contrib/libc++/include/__config
@@ -103,6 +103,9 @@
#if defined(__clang__)
#define _LIBCPP_COMPILER_CLANG
+# ifndef __apple_build_version__
+# define _LIBCPP_CLANG_VER (__clang_major__ * 100 + __clang_minor__)
+# endif
#elif defined(__GNUC__)
#define _LIBCPP_COMPILER_GCC
#elif defined(_MSC_VER)
@@ -111,6 +114,10 @@
#define _LIBCPP_COMPILER_IBM
#endif
+#ifndef _LIBCPP_CLANG_VER
+#define _LIBCPP_CLANG_VER 0
+#endif
+
// FIXME: ABI detection should be done via compiler builtin macros. This
// is just a placeholder until Clang implements such macros. For now assume
// that Windows compilers pretending to be MSVC++ target the microsoft ABI.
@@ -741,7 +748,7 @@ template <unsigned> struct __static_assert_check {};
#ifdef _LIBCPP_HAS_NO_DECLTYPE
// GCC 4.6 provides __decltype in all standard modes.
-#if !__is_identifier(__decltype) || _GNUC_VER >= 406
+#if !__is_identifier(__decltype) || _LIBCPP_CLANG_VER >= 304 || _GNUC_VER >= 406
# define decltype(__x) __decltype(__x)
#else
# define decltype(__x) __typeof__(__x)