================
@@ -16,13 +17,13 @@ using namespace clang::ast_matchers;
namespace clang::tidy::modernize {
static StringRef toStringViewTypeStr(StringRef Type) {
- if (Type.contains("wchar_t"))
+ if (Type.contains("wchar_t") || Type.ends_with("wstring"))
return "std::wstring_view";
- if (Type.contains("char8_t"))
+ if (Type.contains("char8_t") || Type.ends_with("u8string"))
return "std::u8string_view";
- if (Type.contains("char16_t"))
+ if (Type.contains("char16_t") || Type.ends_with("u16string"))
return "std::u16string_view";
- if (Type.contains("char32_t"))
+ if (Type.contains("char32_t") || Type.ends_with("u32string"))
----------------
vbvictor wrote:
Can we make a separate test with mocks that mimic stdlib behavior in Chromium?
Otherwise, someone could refactor this check and break it's "undocumented"
behavoir.
Could you use `getReturnType().getUnqualifiedDesugaredType()`, it should
produce `basic_string<...>`.
https://github.com/llvm/llvm-project/pull/172170
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits