libstdc++: Do not use SFINAE for propagate_const conversions [PR107525]
authorJonathan Wakely <jwakely@redhat.com>
Fri, 4 Nov 2022 15:05:41 +0000 (15:05 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Sat, 5 Nov 2022 14:01:30 +0000 (14:01 +0000)
commit7c6008e75df80607f8104e665e0448a0a9cbf85a
tree7da8e5862b490f7a0f6ffaef7f117bcd0bd0016d
parente50ea3a42f058c14ee29327d5277ab0435e3d36b
libstdc++: Do not use SFINAE for propagate_const conversions [PR107525]

As the PR notes, the current conversion operators are defined as
function templates so that we can use SFINAE. But this changes how they
are considered for overload resolution. This moves those operators into
base classes that can be specialized so the operators are obsent unless
the constraints are satisfied.

libstdc++-v3/ChangeLog:

PR libstdc++/107525
* include/experimental/propagate_const (operator element_type*()):
Move into base class that can be partially specilized to iompose
constraints.
(operator const element_type*()): Likewise.
* testsuite/experimental/propagate_const/observers/107525.cc: New test.
libstdc++-v3/include/experimental/propagate_const
libstdc++-v3/testsuite/experimental/propagate_const/observers/107525.cc [new file with mode: 0644]