With revision 214400 we have the C++14 value of __cplusplus set to the
correct value of 201402L (from 201300L).
We should use this in the std lib headers. This patch does this.
Also, we've set C++14 value of __cplusplus to 201500L so we can start
adding post-C++14 library bits with
#if __cplusplus > 201402L
...
#endif
Built and tested clean on x86_64-linux.
OK?
2014-08-23 Ed Smith-Rowland <3dw...@verizon.net>
* libsupc++/new: Use the C++14 value of __cplusplus as appropriate.
* include/bits/parse_numbers.h: Ditto.
* include/bits/stl_function.h: Ditto.
* include/bits/unique_ptr.h: Ditto.
* include/bits/stl_algo.h: Ditto.
* include/bits/stl_algobase.h: Ditto.
* include/bits/basic_string.h: Ditto.
* include/std/complex: Ditto.
* include/std/iomanip: Ditto.
* include/std/utility: Ditto.
* include/std/type_traits: Ditto.
* include/std/tuple: Ditto.
* include/std/chrono: Ditto.
* include/parallel/algobase.h: Ditto.
Index: libsupc++/new
===================================================================
--- libsupc++/new (revision 214399)
+++ libsupc++/new (working copy)
@@ -81,7 +81,7 @@
// We throw this exception for GNU VLAs of negative length in all C++
// dialects, so declare it if we aren't in strict conformance mode.
-#if __cplusplus > 201103L || !defined(__STRICT_ANSI__)
+#if __cplusplus >= 201402L || !defined(__STRICT_ANSI__)
class bad_array_length : public bad_alloc
{
public:
Index: include/bits/parse_numbers.h
===================================================================
--- include/bits/parse_numbers.h (revision 214399)
+++ include/bits/parse_numbers.h (working copy)
@@ -34,7 +34,7 @@
// From n3642.pdf except I added binary literals and digit separator '\''.
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
#include <limits>
@@ -283,6 +283,6 @@
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
-#endif // __cplusplus > 201103L
+#endif // __cplusplus >= 201402L
#endif // _GLIBCXX_PARSE_NUMBERS_H
Index: include/bits/stl_function.h
===================================================================
--- include/bits/stl_function.h (revision 214399)
+++ include/bits/stl_function.h (working copy)
@@ -56,7 +56,7 @@
#ifndef _STL_FUNCTION_H
#define _STL_FUNCTION_H 1
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
#include <bits/move.h>
#endif
@@ -140,7 +140,7 @@
* @{
*/
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
struct __is_transparent; // undefined
template<typename _Tp = void>
@@ -216,7 +216,7 @@
{ return -__x; }
};
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
template<>
struct plus<void>
{
@@ -311,7 +311,7 @@
*
* @{
*/
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
template<typename _Tp = void>
struct equal_to;
@@ -385,7 +385,7 @@
{ return __x <= __y; }
};
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
/// One of the @link comparison_functors comparison functors@endlink.
template<>
struct equal_to<void>
@@ -481,7 +481,7 @@
*
* @{
*/
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
template<typename _Tp = void>
struct logical_and;
@@ -519,7 +519,7 @@
{ return !__x; }
};
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
/// One of the @link logical_functors Boolean operations functors@endlink.
template<>
struct logical_and<void>
@@ -564,7 +564,7 @@
#endif
/** @} */
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
template<typename _Tp = void>
struct bit_and;
@@ -612,7 +612,7 @@
{ return ~__x; }
};
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
template <>
struct bit_and<void>
{
Index: include/bits/unique_ptr.h
===================================================================
--- include/bits/unique_ptr.h (revision 214399)
+++ include/bits/unique_ptr.h (working copy)
@@ -742,7 +742,7 @@
}
};
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
template<typename _Tp>
struct _MakeUniq
{ typedef unique_ptr<_Tp> __single_object; };
Index: include/bits/stl_algo.h
===================================================================
--- include/bits/stl_algo.h (revision 214399)
+++ include/bits/stl_algo.h (working copy)
@@ -3570,7 +3570,7 @@
__gnu_cxx::__ops::__iter_comp_iter(__pred));
}
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
template<typename _ForwardIterator1, typename _ForwardIterator2,
typename _BinaryPredicate>
bool
Index: include/bits/stl_algobase.h
===================================================================
--- include/bits/stl_algobase.h (revision 214399)
+++ include/bits/stl_algobase.h (working copy)
@@ -1090,7 +1090,7 @@
return true;
}
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
/**
* @brief Tests a range for element-wise equality.
* @ingroup non_mutating_algorithms
@@ -1326,7 +1326,7 @@
__gnu_cxx::__ops::__iter_comp_iter(__binary_pred));
}
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
template<typename _InputIterator1, typename _InputIterator2,
typename _BinaryPredicate>
Index: include/bits/basic_string.h
===================================================================
--- include/bits/basic_string.h (revision 214399)
+++ include/bits/basic_string.h (working copy)
@@ -3138,7 +3138,7 @@
{ };
#endif
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
inline namespace literals
{
@@ -3168,7 +3168,7 @@
} // inline namespace string_literals
} // inline namespace literals
-#endif // __cplusplus > 201103L
+#endif // __cplusplus >= 201402L
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
Index: include/std/complex
===================================================================
--- include/std/complex (revision 214399)
+++ include/std/complex (working copy)
@@ -1924,7 +1924,7 @@
conj(_Tp __x)
{ return __x; }
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
inline namespace literals {
inline namespace complex_literals {
Index: include/std/iomanip
===================================================================
--- include/std/iomanip (revision 214399)
+++ include/std/iomanip (working copy)
@@ -41,7 +41,7 @@
#if __cplusplus >= 201103L
#include <locale>
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
#include <sstream> // used in quoted.
#endif
#endif
@@ -337,7 +337,7 @@
return __os;
}
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
_GLIBCXX_END_NAMESPACE_VERSION
namespace __detail {
@@ -495,7 +495,7 @@
__string, __delim, __escape);
}
-#endif // __cplusplus > 201103L
+#endif // __cplusplus >= 201402L
#endif // __cplusplus >= 201103L
Index: include/std/utility
===================================================================
--- include/std/utility (revision 214399)
+++ include/std/utility (working copy)
@@ -156,7 +156,7 @@
get(const std::pair<_Tp1, _Tp2>& __in) noexcept
{ return __pair_get<_Int>::__const_get(__in); }
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
template <typename _Tp, typename _Up>
constexpr _Tp&
get(pair<_Tp, _Up>& __p) noexcept
@@ -219,7 +219,7 @@
typedef _Index_tuple<> __type;
};
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
/// Class template integer_sequence
template<typename _Tp, _Tp... _Idx>
struct integer_sequence
Index: include/std/type_traits
===================================================================
--- include/std/type_traits (revision 214399)
+++ include/std/type_traits (working copy)
@@ -72,7 +72,7 @@
typedef _Tp value_type;
typedef integral_constant<_Tp, __v> type;
constexpr operator value_type() const { return value; }
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
constexpr value_type operator()() const { return value; }
#endif
};
@@ -1450,7 +1450,7 @@
add_const<typename add_volatile<_Tp>::type>::type type;
};
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
/// Alias template for remove_const
template<typename _Tp>
using remove_const_t = typename remove_const<_Tp>::type;
@@ -1519,7 +1519,7 @@
: public __add_rvalue_reference_helper<_Tp>
{ };
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
/// Alias template for remove_reference
template<typename _Tp>
using remove_reference_t = typename remove_reference<_Tp>::type;
@@ -1750,7 +1750,7 @@
template<>
struct make_signed<bool>;
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
/// Alias template for make_signed
template<typename _Tp>
using make_signed_t = typename make_signed<_Tp>::type;
@@ -1788,7 +1788,7 @@
struct remove_all_extents<_Tp[]>
{ typedef typename remove_all_extents<_Tp>::type type; };
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
/// Alias template for remove_extent
template<typename _Tp>
using remove_extent_t = typename remove_extent<_Tp>::type;
@@ -1829,7 +1829,7 @@
: public __add_pointer_helper<_Tp>
{ };
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
/// Alias template for remove_pointer
template<typename _Tp>
using remove_pointer_t = typename remove_pointer<_Tp>::type;
@@ -2246,7 +2246,7 @@
>::type
{ };
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
/// Alias template for aligned_storage
template<size_t _Len, size_t _Align =
__alignof__(typename __aligned_storage_msa<_Len>::__type)>
Index: include/std/tuple
===================================================================
--- include/std/tuple (revision 214399)
+++ include/std/tuple (working copy)
@@ -686,7 +686,7 @@
typedef typename add_cv<__tuple_element_t<__i, _Tp>>::type type;
};
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
template<std::size_t __i, typename _Tp>
using tuple_element_t = typename tuple_element<__i, _Tp>::type;
#endif
@@ -745,7 +745,7 @@
return std::forward<__element_type&&>(std::get<__i>(__t));
}
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
template<typename _Head, size_t __i, typename... _Tail>
constexpr _Head&
__get_helper2(_Tuple_impl<__i, _Head, _Tail...>& __t) noexcept
Index: include/std/chrono
===================================================================
--- include/std/chrono (revision 214399)
+++ include/std/chrono (working copy)
@@ -780,7 +780,7 @@
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace chrono
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
inline namespace literals
{
@@ -864,7 +864,7 @@
} // inline namespace chrono_literals
} // inline namespace literals
-#endif // __cplusplus > 201103L
+#endif // __cplusplus >= 201402L
// @} group chrono
} // namespace std
Index: include/parallel/algobase.h
===================================================================
--- include/parallel/algobase.h (revision 214399)
+++ include/parallel/algobase.h (working copy)
@@ -114,7 +114,7 @@
std::__iterator_category(__begin2));
}
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
// Sequential fallback.
template<typename _InputIterator1, typename _InputIterator2>
inline pair<_InputIterator1, _InputIterator2>
@@ -231,7 +231,7 @@
== __end1;
}
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
// Sequential fallback
template<typename _IIter1, typename _IIter2>
inline bool