MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / varid_namespace_2

Method varid_namespace_2

test/testvarid.cpp:2437–2454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2435 }
2436
2437 void varid_namespace_2() { // #7000
2438 const char code[] = "namespace Ui {\n"
2439 " class C { int X; };\n" // X@1
2440 "}\n"
2441 "\n"
2442 "class C {\n"
2443 " void dostuff();\n"
2444 " int X;\n" // X@2
2445 "};\n"
2446 "\n"
2447 "void C::dostuff() {\n"
2448 " X = 0;\n" // X@2
2449 "}";
2450
2451 const std::string actual = tokenize(code);
2452
2453 ASSERT(actual.find("X@2 = 0") != std::string::npos);
2454 }
2455
2456 static std::string getLine(const std::string &code, int lineNumber) {
2457 std::string nr = std::to_string(lineNumber);

Callers

nothing calls this directly

Calls 1

findMethod · 0.45

Tested by

no test coverage detected