Skip to content

Commit e2164b6

Browse files
authored
Fix starts_with_insensitive issue clang-18
1 parent 66c7af2 commit e2164b6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/Interpreter/DynamicLibraryManager.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,14 @@ namespace Cpp {
6969
for (const std::string& P : SysPaths)
7070
addSearchPath(P, /*IsUser*/ false);
7171
}
72-
72+
#if LLVM_VERSION_MAJOR < 18
73+
#define starts_with_insensitive startswith_insensitive
74+
#endif
7375
///\returns substitution of pattern in the front of original with replacement
7476
/// Example: substFront("@rpath/abc", "@rpath/", "/tmp") -> "/tmp/abc"
7577
static std::string substFront(StringRef original, StringRef pattern,
7678
StringRef replacement) {
77-
if (!original.startswith_insensitive(pattern))
79+
if (!original.starts_with_insensitive(pattern))
7880
return original.str();
7981
SmallString<512> result(replacement);
8082
result.append(original.drop_front(pattern.size()));

0 commit comments

Comments
 (0)