File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ namespace {
3535void CheckString::stringLiteralWrite ()
3636{
3737 for (const Token* tok = _tokenizer->tokens (); tok; tok = tok->next ()) {
38- if (!tok->variable ())
38+ if (!tok->variable () || !tok-> variable ()-> isPointer () )
3939 continue ;
4040 const Token *str = tok->getValueTokenMinStrSize ();
4141 if (!str)
Original file line number Diff line number Diff line change @@ -111,8 +111,8 @@ class TestString : public TestFixture {
111111 ASSERT_EQUALS (" [test.cpp:3]: (error) Modifying string literal directly or indirectly is undefined behaviour\n " , errout.str ());
112112
113113 check (" void f() {\n "
114- " char * abc = \" abc\" ;\n "
115- " if (* abc == 'a'){} \n "
114+ " QString abc = \" abc\" ;\n "
115+ " abc[0] = 'a'; \n "
116116 " }" );
117117 ASSERT_EQUALS (" " , errout.str ());
118118 }
You can’t perform that action at this time.
0 commit comments