This commit is contained in:
orbitcowboy 2015-01-15 15:26:10 +01:00
commit 20aea9deb3
1 changed files with 11 additions and 0 deletions

View File

@ -3382,6 +3382,17 @@ private:
" struct callbacks ops = { .something = something };\n"
"}\n");
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() {