CPlusPlus: Reuse QScopeGuard instead of ExecuteOnDestruction

Change-Id: Ifb2cf839777c18b4f66a88b7f5106f05148b0c20
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Jarek Kobus
2023-06-03 13:56:37 +02:00
parent deb74751fb
commit f1c04035a6
2 changed files with 14 additions and 13 deletions

View File

@@ -25,7 +25,7 @@
#include "cppassert.h"
#include <utils/executeondestruction.h>
#include <QScopeGuard>
#include <cctype>
@@ -756,9 +756,9 @@ void Lexer::scanStringLiteral(Token *tok, unsigned char hint)
void Lexer::scanRawStringLiteral(Token *tok, unsigned char hint)
{
Utils::ExecuteOnDestruction suffixCleaner;
if (!control())
suffixCleaner.reset([this] { _expectedRawStringSuffix.clear(); });
QScopeGuard cleanup([this] { _expectedRawStringSuffix.clear(); });
if (control())
cleanup.dismiss();
const char *yytext = _currentChar;
@@ -827,7 +827,7 @@ void Lexer::scanRawStringLiteral(Token *tok, unsigned char hint)
tok->f.kind = T_RAW_STRING_LITERAL;
if (!control() && !closed) {
suffixCleaner.reset([]{});
cleanup.dismiss();
s._tokenKind = tok->f.kind;
_expectedRawStringSuffix.prepend(')');
_expectedRawStringSuffix.append('"');