[libcxx] r344616 - Partial fix for PR38964. (<string> can't be built with gcc -std=c++03) Reviewed as https://reviews.llvm.org/D52240

Marshall Clow mclow.lists at gmail.com
Tue Oct 16 09:02:19 PDT 2018


Author: marshall
Date: Tue Oct 16 09:02:18 2018
New Revision: 344616

URL: http://llvm.org/viewvc/llvm-project?rev=344616&view=rev
Log:
Partial fix for PR38964. (<string> can't be built with gcc -std=c++03) Reviewed as https://reviews.llvm.org/D52240

Modified:
    libcxx/trunk/include/string

Modified: libcxx/trunk/include/string
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/string?rev=344616&r1=344615&r2=344616&view=diff
==============================================================================
--- libcxx/trunk/include/string (original)
+++ libcxx/trunk/include/string Tue Oct 16 09:02:18 2018
@@ -807,7 +807,9 @@ public:
     basic_string(basic_string&& __str, const allocator_type& __a);
 #endif  // _LIBCPP_CXX03_LANG
 
+#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
     template <class = typename enable_if<__is_allocator<_Allocator>::value, nullptr_t>::type>
+#endif
     _LIBCPP_INLINE_VISIBILITY
     basic_string(const _CharT* __s) {
       _LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*) detected nullptr");
@@ -817,7 +819,9 @@ public:
 #   endif
     }
 
+#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
     template <class = typename enable_if<__is_allocator<_Allocator>::value, nullptr_t>::type>
+#endif
         _LIBCPP_INLINE_VISIBILITY
         basic_string(const _CharT* __s, const _Allocator& __a);
 
@@ -828,7 +832,9 @@ public:
     _LIBCPP_INLINE_VISIBILITY
     basic_string(size_type __n, _CharT __c);
 
+#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
     template <class = typename enable_if<__is_allocator<_Allocator>::value, nullptr_t>::type>
+#endif
         _LIBCPP_INLINE_VISIBILITY
         basic_string(size_type __n, _CharT __c, const _Allocator& __a);
 
@@ -1781,7 +1787,9 @@ basic_string<_CharT, _Traits, _Allocator
 }
 
 template <class _CharT, class _Traits, class _Allocator>
+#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
 template <class>
+#endif
 basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, const _Allocator& __a)
     : __r_(__second_tag(), __a)
 {
@@ -1918,7 +1926,9 @@ basic_string<_CharT, _Traits, _Allocator
 }
 
 template <class _CharT, class _Traits, class _Allocator>
+#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
 template <class>
+#endif
 basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, _CharT __c, const _Allocator& __a)
     : __r_(__second_tag(), __a)
 {




More information about the libcxx-commits mailing list