diff --git a/cfg/windows.cfg b/cfg/windows.cfg
index 3fe2f36ea..f4bb67aaf 100644
--- a/cfg/windows.cfg
+++ b/cfg/windows.cfg
@@ -644,6 +644,12 @@
+
+
+
+
+
+
diff --git a/lib/tokenlist.cpp b/lib/tokenlist.cpp
index 76f95bf47..2fa66ee62 100644
--- a/lib/tokenlist.cpp
+++ b/lib/tokenlist.cpp
@@ -368,11 +368,12 @@ static bool iscast(const Token *tok)
while (tok2->link() && Token::Match(tok2, "(|[|<"))
tok2 = tok2->link()->next();
- if (tok2->str() == ")")
- return type || tok2->strAt(-1) == "*" || Token::Match(tok2, ") &|~") ||
+ if (tok2->str() == ")") {
+ return type || tok2->strAt(-1) == "*" || Token::simpleMatch(tok2, ") ~") ||
(Token::Match(tok2, ") %any%") &&
!tok2->next()->isOp() &&
!Token::Match(tok2->next(), "[[]);,?:.]"));
+ }
if (!Token::Match(tok2, "%name%|*|&|::"))
return false;
diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp
index 78e1810ca..86e710a0d 100644
--- a/test/testtokenize.cpp
+++ b/test/testtokenize.cpp
@@ -8334,6 +8334,7 @@ private:
// not cast
ASSERT_EQUALS("AB||", testAst("(A)||(B)"));
+ ASSERT_EQUALS("abc[1&=", testAst("a = (b[c]) & 1;"));
}
void astlambda() {
diff --git a/test/testuninitvar.cpp b/test/testuninitvar.cpp
index 963a29ad6..3a01d9724 100644
--- a/test/testuninitvar.cpp
+++ b/test/testuninitvar.cpp
@@ -2553,7 +2553,7 @@ private:
checkUninitVar("void f() {\n" // #4439 - cast address of uninitialized variable
" int a;\n"
- " x((A)(B)&a);\n"
+ " x((LPARAM)(RECT*)&a);\n"
"}");
ASSERT_EQUALS("", errout.str());