diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2023-06-03 13:56:37 +0200 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2023-06-07 10:34:48 +0000 |
commit | f1c04035a60fa098f0d7cc3dac760781a3fb0e84 (patch) | |
tree | 0d4f839e754d1c5d3f9d80b75f96db32b0d7aa1d /src/libs/3rdparty/cplusplus | |
parent | deb74751fb488915f17b855f851120e4a2a7225a (diff) |
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>
Diffstat (limited to 'src/libs/3rdparty/cplusplus')
-rw-r--r-- | src/libs/3rdparty/cplusplus/Lexer.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libs/3rdparty/cplusplus/Lexer.cpp b/src/libs/3rdparty/cplusplus/Lexer.cpp index fc1b72cb7d..deafe432b6 100644 --- a/src/libs/3rdparty/cplusplus/Lexer.cpp +++ b/src/libs/3rdparty/cplusplus/Lexer.cpp @@ -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('"'); |