From 903333aa63661c445d038be56563854f1f09690c Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Tue, 26 May 2026 14:03:50 +0200 Subject: [PATCH 1/4] Update tokenlist.cpp --- lib/tokenlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tokenlist.cpp b/lib/tokenlist.cpp index 6c4cd7eb981..76cb3aa394e 100644 --- a/lib/tokenlist.cpp +++ b/lib/tokenlist.cpp @@ -547,7 +547,7 @@ static bool iscast(const Token *tok, bool cpp) if (!Token::Match(tok2, "%name%|*|::")) return false; - if (tok2->isStandardType() && (tok2->strAt(1) != "(" || Token::Match(tok2->next(), "( * *| )"))) + if (tok2->isStandardType() && (tok2->strAt(1) != "(" || Token::Match(tok2->linkAt(1)->tokAt(-1), "* )"))) type = true; } From 2127a08219f3c396247354e26a05fda240983bd5 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Tue, 26 May 2026 14:05:12 +0200 Subject: [PATCH 2/4] Update testtokenize.cpp --- test/testtokenize.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index a81130c3114..a7e8c40cd37 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -8421,7 +8421,8 @@ class TestTokenizer : public TestFixture { void ccast() { const char code[] = "a = (int)x;\n" // #13579 - "int (*p)[10];\n"; + "int (*p)[10];\n" + "b = (void (S::*)(int) const)&y;"; SimpleTokenizer tokenizer(settingsDefault, *this); ASSERT(tokenizer.tokenize(code)); @@ -8430,6 +8431,8 @@ class TestTokenizer : public TestFixture { ASSERT(par->isCast()); par = Token::findsimplematch(par->next(), "("); ASSERT(!par->isCast()); + par = Token::findsimplematch(par->next(), "("); + ASSERT(par->isCast()); } #define checkHdrs(...) checkHdrs_(__FILE__, __LINE__, __VA_ARGS__) From 618f5fd2d303eb780b8e07466063e04bef935683 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Tue, 26 May 2026 14:06:59 +0200 Subject: [PATCH 3/4] Update tokenlist.cpp --- lib/tokenlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tokenlist.cpp b/lib/tokenlist.cpp index 76cb3aa394e..1ab00ee3574 100644 --- a/lib/tokenlist.cpp +++ b/lib/tokenlist.cpp @@ -547,7 +547,7 @@ static bool iscast(const Token *tok, bool cpp) if (!Token::Match(tok2, "%name%|*|::")) return false; - if (tok2->isStandardType() && (tok2->strAt(1) != "(" || Token::Match(tok2->linkAt(1)->tokAt(-1), "* )"))) + if (tok2->isStandardType() && (tok2->strAt(1) != "(" || Token::simpleMatch(tok2->linkAt(1)->tokAt(-1), "* )"))) type = true; } From 3dab56d07c9a35705da733d0b4af94eed9e6c81f Mon Sep 17 00:00:00 2001 From: chrchr-github Date: Tue, 26 May 2026 19:03:51 +0200 Subject: [PATCH 4/4] Trigger CI