Merge pull request #834 from simartin/ticket_7557

Ticket #7557: Test case added since the fix for #7541 also fixed this.
This commit is contained in:
orbitcowboy 2016-10-01 22:14:09 +02:00 committed by GitHub
commit 30b48cb80a
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)