From 569de7e7fa575fa2758b1c34314e50803e0fe8c0 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Fri, 14 Feb 2025 18:49:34 +0100 Subject: [PATCH] Update symboldatabase.cpp --- lib/symboldatabase.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 473970e6b7d..f0959ff3d26 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -3396,15 +3396,12 @@ void SymbolDatabase::addClassFunction(Scope *&scope, const Token *&tok, const To const Token *closeParen = tok->linkAt(1); if (closeParen) { const Token *eq = TokenList::isFunctionHead(closeParen, ";"); - if (eq) { - if (Token::simpleMatch(eq->tokAt(-2), "= default ;")) { + if (eq && Token::Match(eq->tokAt(-2), "= default|delete ;")) { + if (eq->strAt(-1) == "default") func->isDefault(true); - return; - } - if (Token::simpleMatch(eq->tokAt(-2), "= delete ;")) { + else func->isDelete(true); - return; - } + return; } if (func->type == Function::eDestructor && destructor) { func->hasBody(true);