CppTools: Fix QStringRef and QSharedPointer related issues with Qt6

Task-number: QTCREATORBUG-24098
Change-Id: I97347ac3fb397fea8eee655e3cc4ee252c511885
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Eike Ziller
2020-09-15 15:27:32 +02:00
parent 432247357e
commit 242579099a
10 changed files with 26 additions and 16 deletions

View File

@@ -87,7 +87,9 @@ Tokens SimpleLexer::operator()(const QString &text, int state)
break;
}
QStringRef spell = text.midRef(tk.bytesBegin(), tk.bytes());
const QStringView spell = tk.bytesBegin() + tk.bytes() > text.size()
? QStringView(text).mid(tk.bytesBegin())
: QStringView(text).mid(tk.bytesBegin(), tk.bytes());
lex.setScanAngleStringLiteralTokens(false);
if (tk.newline() && tk.is(T_POUND))