Consider the following example: void init(int*); void foo(void) { int i = ({ init(&i); i; }); } struct widget { int x, y; }; void init2(struct widget*); void bar(void) { struct widget my_widget = ({ init2(&my_widget); my_widget; }); } warning: variable 'my_widget' is uninitialized when used within its own initialization [-Wuninitialized] It seems like it's ok to do so for non-aggregate types, but aggregates issue the warning. I think it should not be a warning here?
Same error, without GCC extension: ```c struct widget { int x, y; }; void init2(struct widget*); void bar(void) { struct widget my_widget = (init2(&my_widget), my_widget); } ```
These examples are undefined in C++, but valid in C; we should probably just disable this warning in C. (Without doing a significantly more sophisticated analysis, it's going to be hard to get it right.)
WIP: https://reviews.llvm.org/D64678
*** This bug has been marked as a duplicate of bug 31829 ***