nickdesaulniers added a comment.

Thanks for the patch. Minor nits looking for test cases that should have no 
warning (like the two examples provided in the bug).



================
Comment at: clang/test/Sema/warn-uninitialized-statement-expression.c:7
+  int i = ({
+    int z = i; // expected-warning{{variable 'i' is uninitialized when used 
within its own initialization}}
+    init(&i);
----------------
Can you please add a case like `foo` without `z` in it (so that no warnings are 
expected, as in pr42604)? (You can keep both test cases, just looking for 1 
more, as the first case).


================
Comment at: clang/test/Sema/warn-uninitialized-statement-expression.c:20
+  struct widget my_widget = ({
+    struct widget z = my_widget; // expected-warning{{variable 'my_widget' is 
uninitialized when used within its own initialization}}
+    int x = my_widget.x;
----------------
Ditto about adding a clear case that should not warn.


================
Comment at: clang/test/Sema/warn-uninitialized-statement-expression.c:21
+    struct widget z = my_widget; // expected-warning{{variable 'my_widget' is 
uninitialized when used within its own initialization}}
+    int x = my_widget.x;
+    init2(&my_widget);
----------------
This needs a trailing comment like:
```
int x = my_widget.x; // fixme: we should probably warn about this case
```
and file a bug about it.  Doesn't need to be solved here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64678/new/

https://reviews.llvm.org/D64678



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to