forked from qt-creator/qt-creator
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:
10
src/libs/3rdparty/cplusplus/Lexer.cpp
vendored
10
src/libs/3rdparty/cplusplus/Lexer.cpp
vendored
@@ -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('"');
|
||||
|
||||
Reference in New Issue
Block a user