Add unit test for #6406
This commit is contained in:
parent
1cc85bfce3
commit
0286abfb45
|
@ -3372,6 +3372,16 @@ private:
|
|||
" this->var = var;\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
// #6406 - false positive for struct with designated initializer
|
||||
check("struct callbacks {\n"
|
||||
" void (*something)(void);\n"
|
||||
"};\n"
|
||||
"void something(void) {}\n"
|
||||
"void f() {\n"
|
||||
" struct callbacks ops = { .something = something };\n"
|
||||
"}\n");
|
||||
TODO_ASSERT_EQUALS("", "[test.cpp:6]: (warning) Redundant assignment of 'something' to itself.\n", errout.str());
|
||||
}
|
||||
|
||||
void trac1132() {
|
||||
|
|
Loading…
Reference in New Issue