<div dir="ltr">This patch should be merge into 4.0 since it is needed to fix compile time regressions in <string> when using Clang 3.4 and C++03.<div><br></div><div>See <a href="https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216054">https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216054</a> for more info.</div><div><br></div><div>/Eric</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 23, 2017 at 2:41 PM, Eric Fiselier via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: ericwf<br>
Date: Mon Jan 23 15:41:13 2017<br>
New Revision: 292833<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=292833&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=292833&view=rev</a><br>
Log:<br>
Manually force the use of __decltype in C++03 with Clang 3.4.<br>
<br>
<string> uses `decltype` in a way incompatible with `__typeof__`.<br>
This is problematic when compiling <string> with Clang 3.4 because<br>
even though it provides `__decltype` libc++ still used `__typeof__`<br>
because clang 3.4 doesn't provide __is_identifier which libc++<br>
uses to detect __decltype.<br>
<br>
This patch manually detects Clang 3.4 and properly configures<br>
for it.<br>
<br>
Modified:<br>
    libcxx/trunk/include/__config<br>
<br>
Modified: libcxx/trunk/include/__config<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=292833&r1=292832&r2=292833&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/include/_<wbr>_config?rev=292833&r1=292832&<wbr>r2=292833&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- libcxx/trunk/include/__config (original)<br>
+++ libcxx/trunk/include/__config Mon Jan 23 15:41:13 2017<br>
@@ -109,6 +109,9 @@<br>
<br>
 #if defined(__clang__)<br>
 #define _LIBCPP_COMPILER_CLANG<br>
+# ifndef __apple_build_version__<br>
+#   define _LIBCPP_CLANG_VER (__clang_major__ * 100 + __clang_minor__)<br>
+# endif<br>
 #elif defined(__GNUC__)<br>
 #define _LIBCPP_COMPILER_GCC<br>
 #elif defined(_MSC_VER)<br>
@@ -117,6 +120,10 @@<br>
 #define _LIBCPP_COMPILER_IBM<br>
 #endif<br>
<br>
+#ifndef _LIBCPP_CLANG_VER<br>
+#define _LIBCPP_CLANG_VER 0<br>
+#endif<br>
+<br>
 // FIXME: ABI detection should be done via compiler builtin macros. This<br>
 // is just a placeholder until Clang implements such macros. For now assume<br>
 // that Windows compilers pretending to be MSVC++ target the microsoft ABI.<br>
@@ -754,7 +761,7 @@ template <unsigned> struct __static_asse<br>
<br>
 #ifdef _LIBCPP_HAS_NO_DECLTYPE<br>
 // GCC 4.6 provides __decltype in all standard modes.<br>
-#if __has_keyword(__decltype) || _GNUC_VER >= 406<br>
+#if __has_keyword(__decltype) || _LIBCPP_CLANG_VER >= 304 || _GNUC_VER >= 406<br>
 #  define decltype(__x) __decltype(__x)<br>
 #else<br>
 #  define decltype(__x) __typeof__(__x)<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>