parent
febe1c9c14
commit
158238ad4b
|
@ -47,6 +47,7 @@ private:
|
||||||
TEST_CASE(structmember_extern); // No false positives for extern structs
|
TEST_CASE(structmember_extern); // No false positives for extern structs
|
||||||
TEST_CASE(structmember10);
|
TEST_CASE(structmember10);
|
||||||
TEST_CASE(structmember11); // #4168 - initialization with {} / passed by address to unknown function
|
TEST_CASE(structmember11); // #4168 - initialization with {} / passed by address to unknown function
|
||||||
|
TEST_CASE(structmember12); // #7179 - FP unused structmember
|
||||||
|
|
||||||
TEST_CASE(localvar1);
|
TEST_CASE(localvar1);
|
||||||
TEST_CASE(localvar2);
|
TEST_CASE(localvar2);
|
||||||
|
@ -392,6 +393,26 @@ private:
|
||||||
TODO_ASSERT_EQUALS("abc::x is not used", "", errout.str());
|
TODO_ASSERT_EQUALS("abc::x is not used", "", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void structmember12() { // #7179
|
||||||
|
checkStructMemberUsage("#include <stdio.h>\n"
|
||||||
|
"struct\n"
|
||||||
|
"{\n"
|
||||||
|
" union\n"
|
||||||
|
" {\n"
|
||||||
|
" struct\n"
|
||||||
|
" {\n"
|
||||||
|
" int a;\n"
|
||||||
|
" } struct1;\n"
|
||||||
|
" };\n"
|
||||||
|
"} var = {0};\n"
|
||||||
|
"int main(int argc, char *argv[])\n"
|
||||||
|
"{\n"
|
||||||
|
" printf(\"var.struct1.a = %d\n\", var.struct1.a);\n"
|
||||||
|
" return 1;\n"
|
||||||
|
"}\n");
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
}
|
||||||
|
|
||||||
void structmember_extern() {
|
void structmember_extern() {
|
||||||
// extern struct => no false positive
|
// extern struct => no false positive
|
||||||
checkStructMemberUsage("extern struct AB\n"
|
checkStructMemberUsage("extern struct AB\n"
|
||||||
|
|
Loading…
Reference in New Issue