mirror of git://gcc.gnu.org/git/gcc.git
Fix namespace versioning and remove __detail::__identity helpers
PR libstdc++/79243 * include/bits/c++config (literals::string_view_literals::__7): Add. Only declare versioned namespaces for the relevant C++ dialects. * include/experimental/bits/erase_if.h (fundamentals_v2::__detail): Add versioning macros. * include/experimental/bits/lfts_config.h: (fundamentals_v1::__detail::__7, fundamentals_v2::__detail::__7): Add. * include/experimental/string_view (fundamentals_v2::__detail): Add versioning macros. (fundamentals_v2::__detail::__identity): Remove. (fundamentals_v2::__detail::__idt): Use common_type instead of __detail::__identity. * include/std/string_view (__detail::__identity, __detail::__idt): Likewise. (literals::string_view_literals): Fix nesting of versioning macros. From-SVN: r244945
This commit is contained in:
parent
b3db8d779a
commit
3e5fb20f1f
|
|
@ -1,5 +1,21 @@
|
||||||
2017-01-26 Jonathan Wakely <jwakely@redhat.com>
|
2017-01-26 Jonathan Wakely <jwakely@redhat.com>
|
||||||
|
|
||||||
|
PR libstdc++/79243
|
||||||
|
* include/bits/c++config (literals::string_view_literals::__7): Add.
|
||||||
|
Only declare versioned namespaces for the relevant C++ dialects.
|
||||||
|
* include/experimental/bits/erase_if.h (fundamentals_v2::__detail):
|
||||||
|
Add versioning macros.
|
||||||
|
* include/experimental/bits/lfts_config.h:
|
||||||
|
(fundamentals_v1::__detail::__7, fundamentals_v2::__detail::__7): Add.
|
||||||
|
* include/experimental/string_view (fundamentals_v2::__detail):
|
||||||
|
Add versioning macros.
|
||||||
|
(fundamentals_v2::__detail::__identity): Remove.
|
||||||
|
(fundamentals_v2::__detail::__idt): Use common_type instead of
|
||||||
|
__detail::__identity.
|
||||||
|
* include/std/string_view (__detail::__identity, __detail::__idt):
|
||||||
|
Likewise.
|
||||||
|
(literals::string_view_literals): Fix nesting of versioning macros.
|
||||||
|
|
||||||
PR libstdc++/79190
|
PR libstdc++/79190
|
||||||
* libsupc++/del_opa.cc (operator delete(void*, std::align_val_t))
|
* libsupc++/del_opa.cc (operator delete(void*, std::align_val_t))
|
||||||
[!_GLIBCXX_HAVE_ALIGNED_ALLOC && !_GLIBCXX_HAVE_POSIX_MEMALIGN
|
[!_GLIBCXX_HAVE_ALIGNED_ALLOC && !_GLIBCXX_HAVE_POSIX_MEMALIGN
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,9 @@
|
||||||
namespace __profile { }
|
namespace __profile { }
|
||||||
namespace __cxx1998 { }
|
namespace __cxx1998 { }
|
||||||
|
|
||||||
namespace __detail { }
|
namespace __detail {
|
||||||
|
namespace __variant { } // C++17
|
||||||
|
}
|
||||||
|
|
||||||
namespace rel_ops { }
|
namespace rel_ops { }
|
||||||
|
|
||||||
|
|
@ -194,14 +196,15 @@
|
||||||
|
|
||||||
namespace decimal { }
|
namespace decimal { }
|
||||||
|
|
||||||
namespace chrono { }
|
namespace chrono { } // C++11
|
||||||
namespace placeholders { }
|
namespace placeholders { } // C++11
|
||||||
namespace regex_constants { }
|
namespace regex_constants { } // C++11
|
||||||
namespace this_thread { }
|
namespace this_thread { } // C++11
|
||||||
inline namespace literals {
|
inline namespace literals { // C++14
|
||||||
inline namespace chrono_literals { }
|
inline namespace chrono_literals { } // C++14
|
||||||
inline namespace complex_literals { }
|
inline namespace complex_literals { } // C++14
|
||||||
inline namespace string_literals { }
|
inline namespace string_literals { } // C++14
|
||||||
|
inline namespace string_view_literals { } // C++17
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -282,20 +285,29 @@ namespace std
|
||||||
|
|
||||||
namespace decimal { inline namespace __7 { } }
|
namespace decimal { inline namespace __7 { } }
|
||||||
|
|
||||||
|
#if __cplusplus >= 201103L
|
||||||
namespace chrono { inline namespace __7 { } }
|
namespace chrono { inline namespace __7 { } }
|
||||||
namespace placeholders { inline namespace __7 { } }
|
namespace placeholders { inline namespace __7 { } }
|
||||||
namespace regex_constants { inline namespace __7 { } }
|
namespace regex_constants { inline namespace __7 { } }
|
||||||
namespace this_thread { inline namespace __7 { } }
|
namespace this_thread { inline namespace __7 { } }
|
||||||
|
|
||||||
|
#if __cplusplus >= 201402L
|
||||||
inline namespace literals {
|
inline namespace literals {
|
||||||
inline namespace chrono_literals { inline namespace __7 { } }
|
inline namespace chrono_literals { inline namespace __7 { } }
|
||||||
inline namespace complex_literals { inline namespace __7 { } }
|
inline namespace complex_literals { inline namespace __7 { } }
|
||||||
inline namespace string_literals { inline namespace __7 { } }
|
inline namespace string_literals { inline namespace __7 { } }
|
||||||
|
#if __cplusplus > 201402L
|
||||||
|
inline namespace string_view_literals { inline namespace __7 { } }
|
||||||
|
#endif // C++17
|
||||||
}
|
}
|
||||||
|
#endif // C++14
|
||||||
|
#endif // C++11
|
||||||
|
|
||||||
namespace __detail {
|
namespace __detail {
|
||||||
inline namespace __7 { }
|
inline namespace __7 { }
|
||||||
|
#if __cplusplus > 201402L
|
||||||
namespace __variant { inline namespace __7 { } }
|
namespace __variant { inline namespace __7 { } }
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,9 +43,9 @@ namespace experimental
|
||||||
{
|
{
|
||||||
inline namespace fundamentals_v2
|
inline namespace fundamentals_v2
|
||||||
{
|
{
|
||||||
|
|
||||||
namespace __detail
|
namespace __detail
|
||||||
{
|
{
|
||||||
|
_GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
template<typename _Container, typename _Predicate>
|
template<typename _Container, typename _Predicate>
|
||||||
void
|
void
|
||||||
__erase_nodes_if(_Container& __cont, _Predicate __pred)
|
__erase_nodes_if(_Container& __cont, _Predicate __pred)
|
||||||
|
|
@ -59,9 +59,8 @@ inline namespace fundamentals_v2
|
||||||
++__iter;
|
++__iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
_GLIBCXX_END_NAMESPACE_VERSION
|
||||||
|
} // namespace __detail
|
||||||
|
|
||||||
} // inline namespace fundamentals_v2
|
} // inline namespace fundamentals_v2
|
||||||
} // namespace experimental
|
} // namespace experimental
|
||||||
} // namespace std
|
} // namespace std
|
||||||
|
|
|
||||||
|
|
@ -46,10 +46,14 @@ inline namespace fundamentals_v2 { inline namespace __7 { } }
|
||||||
|
|
||||||
namespace experimental
|
namespace experimental
|
||||||
{
|
{
|
||||||
inline namespace fundamentals_v1 { inline namespace __7 { } }
|
inline namespace fundamentals_v1 {
|
||||||
|
inline namespace __7 { }
|
||||||
|
namespace __detail { inline namespace __7 { } }
|
||||||
|
}
|
||||||
inline namespace fundamentals_v2 {
|
inline namespace fundamentals_v2 {
|
||||||
inline namespace __7 { }
|
inline namespace __7 { }
|
||||||
namespace pmr { inline namespace __7 { } }
|
namespace pmr { inline namespace __7 { } }
|
||||||
|
namespace __detail { inline namespace __7 { } }
|
||||||
} // namespace fundamentals_v2
|
} // namespace fundamentals_v2
|
||||||
inline namespace literals { inline namespace string_view_literals {
|
inline namespace literals { inline namespace string_view_literals {
|
||||||
inline namespace __7 { }
|
inline namespace __7 { }
|
||||||
|
|
|
||||||
|
|
@ -434,24 +434,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
const _CharT* _M_str;
|
const _CharT* _M_str;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
_GLIBCXX_END_NAMESPACE_VERSION
|
||||||
|
|
||||||
// [string.view.comparison], non-member basic_string_view comparison functions
|
// [string.view.comparison], non-member basic_string_view comparison functions
|
||||||
|
|
||||||
namespace __detail
|
namespace __detail
|
||||||
{
|
{
|
||||||
// Identity transform to make ADL work with just one argument.
|
_GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
// See n3766.html.
|
// Identity transform to create a non-deduced context, so that only one
|
||||||
template<typename _Tp = void>
|
// argument participates in template argument deduction and the other
|
||||||
struct __identity
|
// argument gets implicitly converted to the deduced type. See n3766.html.
|
||||||
{ typedef _Tp type; };
|
|
||||||
|
|
||||||
template<>
|
|
||||||
struct __identity<void>;
|
|
||||||
|
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
using __idt = typename __identity<_Tp>::type;
|
using __idt = common_type_t<_Tp>;
|
||||||
|
_GLIBCXX_END_NAMESPACE_VERSION
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
|
|
||||||
template<typename _CharT, typename _Traits>
|
template<typename _CharT, typename _Traits>
|
||||||
inline bool
|
inline bool
|
||||||
operator==(basic_string_view<_CharT, _Traits> __x,
|
operator==(basic_string_view<_CharT, _Traits> __x,
|
||||||
|
|
|
||||||
|
|
@ -430,20 +430,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
_GLIBCXX_END_NAMESPACE_VERSION
|
_GLIBCXX_END_NAMESPACE_VERSION
|
||||||
|
|
||||||
// [string.view.comparison], non-member basic_string_view comparison function
|
// [string.view.comparison], non-member basic_string_view comparison function
|
||||||
|
|
||||||
namespace __detail
|
namespace __detail
|
||||||
{
|
{
|
||||||
_GLIBCXX_BEGIN_NAMESPACE_VERSION
|
_GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
// Identity transform to make ADL work with just one argument.
|
// Identity transform to create a non-deduced context, so that only one
|
||||||
// See n3766.html.
|
// argument participates in template argument deduction and the other
|
||||||
template<typename _Tp = void>
|
// argument gets implicitly converted to the deduced type. See n3766.html.
|
||||||
struct __identity
|
|
||||||
{ typedef _Tp type; };
|
|
||||||
|
|
||||||
template<>
|
|
||||||
struct __identity<void>;
|
|
||||||
|
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
using __idt = typename __identity<_Tp>::type;
|
using __idt = common_type_t<_Tp>;
|
||||||
_GLIBCXX_END_NAMESPACE_VERSION
|
_GLIBCXX_END_NAMESPACE_VERSION
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -639,6 +634,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
struct __is_fast_hash<hash<u32string_view>> : std::false_type
|
struct __is_fast_hash<hash<u32string_view>> : std::false_type
|
||||||
{ };
|
{ };
|
||||||
#endif
|
#endif
|
||||||
|
_GLIBCXX_END_NAMESPACE_VERSION
|
||||||
|
|
||||||
inline namespace literals
|
inline namespace literals
|
||||||
{
|
{
|
||||||
|
|
@ -670,7 +666,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
} // namespace string_literals
|
} // namespace string_literals
|
||||||
} // namespace literals
|
} // namespace literals
|
||||||
|
|
||||||
_GLIBCXX_END_NAMESPACE_VERSION
|
|
||||||
} // namespace std
|
} // namespace std
|
||||||
|
|
||||||
#include <bits/string_view.tcc>
|
#include <bits/string_view.tcc>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue