From 46d54a136eefc95a64ffe9e286db7b3cd40af0bf Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Tue, 11 Nov 2025 08:13:20 +0100 Subject: [PATCH] Revert "Fix #14256 syntaxError for C++23 lambda without parameter clause (#7953)" This reverts commit 3cfa70d4660b50889902e783291a58e49631a4a4. --- lib/tokenize.cpp | 2 +- test/testtokenize.cpp | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index c69e73d03be..608991ce596 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -8920,7 +8920,7 @@ void Tokenizer::findGarbageCode() const if (Token::Match(tok, "!|~ %comp%") && !(cpp && tok->strAt(1) == ">" && Token::simpleMatch(tok->tokAt(-1), "operator"))) syntaxError(tok); - if (Token::Match(tok, "] %name%") && (!cpp || !(tok->tokAt(1)->isKeyword() || (tok->tokAt(-1) && Token::simpleMatch(tok->tokAt(-2), "delete ["))))) { + if (Token::Match(tok, "] %name%") && (!cpp || !(tok->tokAt(-1) && Token::simpleMatch(tok->tokAt(-2), "delete [")))) { if (tok->next()->isUpperCaseName()) unknownMacroError(tok->next()); else diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 97ae9f9b9e3..7c7142516fb 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -7994,12 +7994,6 @@ class TestTokenizer : public TestFixture { "int main() { \n" " takesFunc([func = [](S s) { return s.c; }] {});\n" "}\n")); - - ASSERT_NO_THROW(tokenizeAndStringify("void f() {\n" // #14256 - " int i = 0;\n" - " auto x = [i] mutable {};\n" - "}\n")); - ignore_errout(); } void checkIfCppCast() {