rsmith added a comment.

In D80055#2055151 <https://reviews.llvm.org/D80055#2055151>, @jfb wrote:

> I was wondering if any of the tests were surprising to you, or if the 
> behavior described was as expected?


I've highlighted one case where the test expectation doesn't match the standard 
rules.



================
Comment at: clang/test/CodeGen/union-tail-padding.c:42
+#elif __cplusplus < 201703
+Front front6 = Front(); // expected-warning {{Initializing union 'Front' field 
'i' only initializes the first 4 of 8 bytes, leaving the remaining 4 bytes 
undefined}}
+Front front7 = Front{}; // expected-warning {{Initializing union 'Front' field 
'i' only initializes the first 4 of 8 bytes, leaving the remaining 4 bytes 
undefined}}
----------------
This warning appears to be incorrect. Value-initialization of a union with a 
trivial default constructor performs zero-initialization, which does zero out 
padding bits.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80055



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

Reply via email to