diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2022-09-26 18:59:45 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2022-09-26 23:47:37 +0100 |
commit | 03cb9ed8dd603dbb77762ca948fc6381ba190731 (patch) | |
tree | b7259318f6ef5cf0fa4309f22452c303287e49f2 /libgcc/ChangeLog | |
parent | af85ad891703db220b25e7847f10d0bbec4becf4 (diff) | |
download | gcc-03cb9ed8dd603dbb77762ca948fc6381ba190731.zip gcc-03cb9ed8dd603dbb77762ca948fc6381ba190731.tar.gz gcc-03cb9ed8dd603dbb77762ca948fc6381ba190731.tar.bz2 |
libstdc++: Update std::pointer_traits to match new LWG 3545 wording
It was pointed out in recent LWG 3545 discussion that having a
constrained partial specialization of std::pointer_traits can cause
ambiguities with program-defined specializations. For example, the
addition to the testcase has:
template<typename P> requires std::derived_from<P, base_type
struct std::pointer_traits<P>;
This would be ambiguous with the library's own constrained partial
specialization:
template<typename Ptr> requires requires { typename Ptr::element_type; }
struct std::pointer_traits<Ptr>;
Neither specialization is more specialized than the other for a type
that is derived from base_type and also has an element_type member.
The solution is to remove the library's partial specialization, and do
the check for Ptr::element_type in the __ptr_traits_elem helper (which
is what we already do for !__cpp_concepts anyway).
libstdc++-v3/ChangeLog:
* include/bits/ptr_traits.h (__ptr_traits_elem) [__cpp_concepts]:
Also define the __ptr_traits_elem class template for the
concepts case.
(pointer_traits<Ptr>): Remove constrained partial
specialization.
* testsuite/20_util/pointer_traits/lwg3545.cc: Check for
ambiguitiy with program-defined partial specialization.
Diffstat (limited to 'libgcc/ChangeLog')
0 files changed, 0 insertions, 0 deletions