Add more complex variation of the #6406 unit test
This is a false negative right now.
This commit is contained in:
parent
4222333785
commit
cf64fd3dad
|
@ -3382,6 +3382,17 @@ private:
|
||||||
" struct callbacks ops = { .something = something };\n"
|
" struct callbacks ops = { .something = something };\n"
|
||||||
"}\n");
|
"}\n");
|
||||||
TODO_ASSERT_EQUALS("", "[test.cpp:6]: (warning) Redundant assignment of 'something' to itself.\n", errout.str());
|
TODO_ASSERT_EQUALS("", "[test.cpp:6]: (warning) Redundant assignment of 'something' to itself.\n", errout.str());
|
||||||
|
|
||||||
|
// #6406 - designated initializer doing bogus self assignment
|
||||||
|
check("struct callbacks {\n"
|
||||||
|
" void (*something)(void);\n"
|
||||||
|
"};\n"
|
||||||
|
"void something(void) {}\n"
|
||||||
|
"void f() {\n"
|
||||||
|
" struct callbacks ops = { .something = ops.something };\n"
|
||||||
|
"}\n");
|
||||||
|
TODO_ASSERT_EQUALS("[test.cpp:6]: (warning) Redundant assignment of 'something' to itself.\n", "", errout.str());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void trac1132() {
|
void trac1132() {
|
||||||
|
|
Loading…
Reference in New Issue