forked from qt-creator/qt-creator
ClangFormat: Fix compiliation with LLVM19
Change-Id: I4b166da2e477ffd101a5c4b9aa07c710f7698da9 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
committed by
Björn Schäpers
parent
a0b19d9fba
commit
cc9ffdb685
@@ -65,7 +65,11 @@ static void adjustFormatStyleForLineBreak(clang::format::FormatStyle &style,
|
|||||||
|
|
||||||
static llvm::StringRef clearExtraNewline(llvm::StringRef text)
|
static llvm::StringRef clearExtraNewline(llvm::StringRef text)
|
||||||
{
|
{
|
||||||
|
#if LLVM_VERSION_MAJOR >= 16
|
||||||
|
while (text.starts_with("\n\n"))
|
||||||
|
#else
|
||||||
while (text.startswith("\n\n"))
|
while (text.startswith("\n\n"))
|
||||||
|
#endif
|
||||||
text = text.drop_front();
|
text = text.drop_front();
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
@@ -127,7 +127,11 @@ public:
|
|||||||
/// Gets real path of \p Path e.g. collapse all . and .. patterns, resolve
|
/// Gets real path of \p Path e.g. collapse all . and .. patterns, resolve
|
||||||
/// symlinks. For real file system, this uses `llvm::sys::fs::real_path`.
|
/// symlinks. For real file system, this uses `llvm::sys::fs::real_path`.
|
||||||
/// This returns errc::operation_not_permitted if not implemented by subclass.
|
/// This returns errc::operation_not_permitted if not implemented by subclass.
|
||||||
std::error_code getRealPath(const Twine &Path, SmallVectorImpl<char> &Output) const override
|
std::error_code getRealPath(const Twine &Path, SmallVectorImpl<char> &Output)
|
||||||
|
#if LLVM_VERSION_MAJOR < 19
|
||||||
|
const
|
||||||
|
#endif
|
||||||
|
override
|
||||||
{
|
{
|
||||||
Q_UNUSED(Path);
|
Q_UNUSED(Path);
|
||||||
Q_UNUSED(Output);
|
Q_UNUSED(Output);
|
||||||
|
Reference in New Issue
Block a user