[PATCH] [libc++] Fix std::begin() and std::end() for array type.

Logan Chien tzuhsiang.chien at gmail.com
Wed Dec 11 09:16:17 PST 2013


The std::begin() and std::end() for array type should not be
guarded with _LIBCXX_HAS_NO_TRAILING_RETURN.

This commit will fix the libc++ compilation for g++ 4.6.

http://llvm-reviews.chandlerc.com/D2386

Files:
  include/iterator

Index: include/iterator
===================================================================
--- include/iterator
+++ include/iterator
@@ -1385,8 +1385,6 @@
     return __x;
 }
 
-#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN)
-
 template <class _Tp, size_t _Np>
 inline _LIBCPP_INLINE_VISIBILITY
 _Tp*
@@ -1403,6 +1401,8 @@
     return __array + _Np;
 }
 
+#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN)
+
 template <class _Cp>
 inline _LIBCPP_INLINE_VISIBILITY
 auto
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2386.1.patch
Type: text/x-patch
Size: 556 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131211/98e22b34/attachment.bin>


More information about the cfe-commits mailing list