https://bugs.kde.org/show_bug.cgi?id=357585

--- Comment #4 from Kevin Funk <kf...@kde.org> ---
Can you reliably reproduce the issue?

If you can please, apply the following patch and try to reproduce.

diff --git a/languages/clang/util/clangutils.cpp
b/languages/clang/util/clangutils.cpp
index 7b0c0bb..eb7fe8a 100644
--- a/languages/clang/util/clangutils.cpp
+++ b/languages/clang/util/clangutils.cpp
@@ -269,15 +269,15 @@ QByteArray ClangUtils::getRawContents(CXTranslationUnit
unit, CXSourceRange rang
     const auto rangeStart = clang_getRangeStart(range);
     const auto rangeEnd = clang_getRangeEnd(range);
     unsigned int start, end;
-    clang_getFileLocation(rangeStart, nullptr, nullptr, nullptr, &start);
-    clang_getFileLocation(rangeEnd, nullptr, nullptr, nullptr, &end);
+    clang_getSpellingLocation(rangeStart, nullptr, nullptr, nullptr, &start);
+    clang_getSpellingLocation(rangeEnd, nullptr, nullptr, nullptr, &end);

     QByteArray result;
     const ClangTokens tokens(unit, range);
     for (CXToken token : tokens) {
-        const auto location = ClangLocation(clang_getTokenLocation(unit,
token));
+        const auto location = clang_getTokenLocation(unit, token);
         unsigned int offset;
-        clang_getFileLocation(location, nullptr, nullptr, nullptr, &offset);
+        clang_getSpellingLocation(location, nullptr, nullptr, nullptr,
&offset);
         Q_ASSERT(offset >= start);
         const int fillCharacters = offset - start - result.size();
         Q_ASSERT(fillCharacters >= 0);

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to