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:
commit
30b48cb80a
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue