danmar/cppcheck — comment on commit b9c796d9f89c7d87537569acfae978472e538ea8
File: lib/symboldatabase.cpp line 1492
By edward-san:

Let me explain why I don't think it is necessary:

https://github.com/danmar/cppcheck/commit/0d3bf5340d338f2a1795c81dfa2e0722a6f4e9d5#diff-1

In getVariableList I replaced a 'Token::Match' + similar string compare with 'string compare inside a string compare' (in this commit), which is more convenient and this handles good with legal C++ code, and so I copypasted that to setVarId to ensure that all legal C++ 'using' code doesn't have a non-null varId. Just check the code below with --debug:

```
namespace A { void f (); }

using A::f;
using namespace std;
```

no varids and no messages.

If there isn't 'using %var%;' strings check in the cppcheck checks, then the removal of it from the tokenizer is a real waste.

Where's the problem, then? Which code would confuse cppcheck? No one answered that with facts.

And if you're right about removing the C# 'using', you didn't answer to the question in the other commit:

> Robert, is it sufficient if I remove 'using %var%;' in simplifyJavaAndCSharp?