You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C:\Users\ALEXG~1\AppData\Local\Temp>cl /Od /MDd repro.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.42.34226.3 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
repro.cpp
C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.42.34226\include\__msvc_string_view.hpp(664): error C2338: static_assert failed: 'Standard char_traits is only provided for char, wchar_t, char16_t, and char32_t. See N4950 [char.traits]. Visual C++ accepts other unsigned integral types as an extension.'
C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.42.34226\include\__msvc_string_view.hpp(664): note: the template instantiation context (the oldest one first) is
repro.cpp(107): note: see reference to class template instantiation 'std::basic_string<odd_char,std::char_traits<odd_char>,std::allocator<odd_char>>' being compiled
C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.42.34226\include\xstring(2693): note: while compiling class template member function 'unsigned __int64 std::basic_string<odd_char,std::char_traits<odd_char>,std::allocator<odd_char>>::find_last_of(const std::basic_string<odd_char,std::char_traits<odd_char>,std::allocator<odd_char>> &,unsigned __int64) noexcept const'
repro.cpp(119): note: see the first reference to 'std::basic_string<odd_char,std::char_traits<odd_char>,std::allocator<odd_char>>::find_last_of' in 'main'
C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.42.34226\include\xstring(2695): note: see reference to function template instantiation 'size_t std::_Traits_find_last_of<_Traits,true>(const odd_char *const ,const size_t,const size_t,const odd_char *const ,const size_t) noexcept' being compiled
with
[
_Traits=std::char_traits<odd_char>
]
C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.42.34226\include\__msvc_string_view.hpp(730): note: see reference to class template instantiation 'std::_String_bitmap<std::char_traits<odd_char>::char_type,false>' being compiled
Expected behavior
Should compile
STL version
Version 17.12.0 Preview 1.0
The text was updated successfully, but these errors were encountered:
AlexGuteniev
changed the title
<string>: basic_string<unicorn>::find_meow_of family with std::string_traits<unicorn> specialization are not supported<string>: basic_string<unicorn>::find_meow_of family with std::char_traits<unicorn> specialization are not supported
Sep 3, 2024
Describe the bug
Discovered when trying to make follow up optimizations after #4744
basic_string
with odd types andchar_traits
specialization instd::
can exist.From [namespace.std]/2 :
However with
std::char_traits<unicorn>
specialization provided,basic_string<unicorn>::find_first_of
fails to compile here:STL/stl/inc/__msvc_string_view.hpp
Lines 678 to 680 in 91e4255
Command-line test case
Expected behavior
Should compile
STL version
Version 17.12.0 Preview 1.0
The text was updated successfully, but these errors were encountered: