Ticket #7557: Test case added since the fix for #7541 also fixed this.

This commit is contained in:
Simon Martin 2016-10-01 21:21:07 +02:00
parent f00636c0d3
commit d3c6fb4ccf
1 changed files with 19 additions and 0 deletions

View File

@ -174,6 +174,7 @@ private:
TEST_CASE(usingNamespace); // #4585
TEST_CASE(lambdaFunction); // #5078
TEST_CASE(namespaces); // #7557
}
void checkStructMemberUsage(const char code[]) {
@ -4070,6 +4071,24 @@ private:
"}");
TODO_ASSERT_EQUALS("[test.cpp:3]: (style) Variable 'x' is assigned a value that is never used.\n", "", errout.str());
}
void namespaces() { // #7557
functionVariableUsage("namespace t { namespace g {\n"
" typedef std::pair<BoostBox, size_t> value;\n"
"} }\n"
"namespace t { namespace g {} }\n"
"namespace t {\n"
" inline double getTime() const {\n"
" iterator it=find();\n"
" double& value=it->second.values[index];\n"
" if(isnan(value)) {\n"
" value=get();\n"
" }\n"
" return value;\n"
" }\n"
"}");
ASSERT_EQUALS("", errout.str());
}
};
REGISTER_TEST(TestUnusedVar)