From 391b17803c6887a365e8673c675fa9e2aea450b2 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Tue, 14 May 2024 15:22:08 +0200 Subject: [PATCH 1/2] Update tokenize.cpp --- lib/tokenize.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 07bc29f4580..42d50f63571 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -102,7 +102,7 @@ const Token * Tokenizer::isFunctionHead(const Token *tok, const std::string &end tok = tok->link(); if (tok->str() != ")") return nullptr; - if (!tok->isCpp() && !Token::Match(tok->link()->previous(), "%name%|)")) + if (!tok->isCpp() && !Token::Match(tok->link()->previous(), "%name%|(|)")) return nullptr; if (Token::Match(tok, ") ;|{|[")) { tok = tok->next(); From f66c86abe2bb1e136452607ac42b0cefb0cc245b Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Tue, 14 May 2024 15:28:50 +0200 Subject: [PATCH 2/2] Update testvarid.cpp --- test/testvarid.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/testvarid.cpp b/test/testvarid.cpp index ea8934b2403..02ea62f6f3d 100644 --- a/test/testvarid.cpp +++ b/test/testvarid.cpp @@ -1294,6 +1294,10 @@ class TestVarID : public TestFixture { const char code3[] = "extern void (*arr[10])(uint32_t some);\n"; const char expected3[] = "1: extern void ( * arr@1 [ 10 ] ) ( uint32_t some@2 ) ;\n"; ASSERT_EQUALS(expected3, tokenize(code3, true)); + + const char code4[] = "_Static_assert(sizeof((struct S){0}.i) == 4);\n"; // #12729 + const char expected4[] = "1: _Static_assert ( sizeof ( ( struct S ) { 0 } . i ) == 4 ) ;\n"; + ASSERT_EQUALS(expected4, tokenize(code4, false)); } void varid71() {