Skip to content

Commit 20ff570

Browse files
committed
vr: avoid missing std::char_traits<const T>
In newer versions of libc++, std::char_traits<T> is only defined for character types (and not const/volatile-qualified character types). See https://discourse.llvm.org/t/deprecating-std-string-t-for-non-character-t/66779. Remove the cv qualifiers from CharT first. Keep qualifiers on value_type and typedefs derived from it. This library appears to be unused (see b/253514421#comment11), but it still builds with a "checkbuild", so it blocks the libc++ update (b/175635923). Bug: 175635923 Test: make checkbuild Test: m MODULES-IN-frameworks-native-libs-vr Test: /data/nativetest64/pdx_tests/pdx_tests Change-Id: I2bfa04ccd073f8701597be8618bb8b48eb695afe
1 parent 3b17f28 commit 20ff570

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

libs/vr/libpdx/private/pdx/rpc/string_wrapper.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ namespace rpc {
1717
// C strings more efficient by avoiding unnecessary copies when remote method
1818
// signatures specify std::basic_string arguments or return values.
1919
template <typename CharT = std::string::value_type,
20-
typename Traits = std::char_traits<CharT>>
20+
typename Traits = std::char_traits<std::remove_cv_t<CharT>>>
2121
class StringWrapper {
2222
public:
2323
// Define types in the style of STL strings to support STL operators.
2424
typedef Traits traits_type;
25-
typedef typename Traits::char_type value_type;
25+
typedef CharT value_type;
2626
typedef std::size_t size_type;
2727
typedef value_type& reference;
2828
typedef const value_type& const_reference;

0 commit comments

Comments
 (0)