File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -254,8 +254,11 @@ void CheckString::strPlusCharError(const Token *tok)
254254static bool isMacroUsage (const Token* tok)
255255{
256256 if (const Token* parent = tok->astParent ()) {
257- while (parent && (parent->isCast () || parent->str () == " &&" ))
257+ while (parent && (parent->isCast () || parent->str () == " &&" )) {
258+ if (parent->isExpandedMacro ())
259+ return true ;
258260 parent = parent->astParent ();
261+ }
259262 if (!parent)
260263 return false ;
261264 if (parent->isExpandedMacro ())
Original file line number Diff line number Diff line change @@ -808,6 +808,12 @@ class TestString : public TestFixture {
808808 " MACRO(false && \" abc\" );\n "
809809 " }\n " );
810810 ASSERT_EQUALS (" " , errout_str ());
811+
812+ check (" #define strequ(s1,s2) ((void *)s1 && (void *)s2 && strcmp(s1, s2) == 0)\n " // #13093
813+ " void f(const char* p) {\n "
814+ " if (strequ(p, \" ALL\" )) {}\n "
815+ " }\n " );
816+ ASSERT_EQUALS (" " , errout_str ());
811817 }
812818
813819 void deadStrcmp () {
You can’t perform that action at this time.
0 commit comments