[PATCH] D80055: Diagnose union tail padding

2020-06-19 Thread JF Bastien via Phabricator via cfe-commits
jfb abandoned this revision. jfb added a comment. I've gotten what I wanted out of this (diagnosed a particular codebase), and am not sure it's worth pursuing further. If anyone is interested, please let me know. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://review

[PATCH] D80055: Diagnose union tail padding

2020-05-26 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In 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.

[PATCH] D80055: Diagnose union tail padding

2020-05-26 Thread JF Bastien via Phabricator via cfe-commits
jfb added a comment. In D80055#2042630 , @rsmith wrote: > I'm not convinced that this is an especially useful diagnostic (much like > with `-Wpadded`), but I'm also not opposed if you are aware of cases where it > would be used. I wrote it to help with

[PATCH] D80055: Diagnose union tail padding

2020-05-18 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. I'm not convinced that this is an especially useful diagnostic (much like with `-Wpadded`), but I'm also not opposed if you are aware of cases where it would be used. It seems worth pointing out that, at least in C, merely assigning to a union member results in all padd

[PATCH] D80055: Diagnose union tail padding

2020-05-18 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added inline comments. Comment at: clang/test/CodeGen/union-tail-padding.c:28-36 +union Front { + int i; + long long ll; +}; + +union Front front1; +union Front front2 = {};// expected-warning {{Initializing union 'Front' field 'i' only initializes the first

[PATCH] D80055: Diagnose union tail padding

2020-05-18 Thread JF Bastien via Phabricator via cfe-commits
jfb marked an inline comment as done. jfb added inline comments. Comment at: clang/test/CodeGen/union-tail-padding.c:28-36 +union Front { + int i; + long long ll; +}; + +union Front front1; +union Front front2 = {};// expected-warning {{Initializing union 'Front' field

[PATCH] D80055: Diagnose union tail padding

2020-05-18 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added inline comments. Comment at: clang/test/CodeGen/union-tail-padding.c:28-36 +union Front { + int i; + long long ll; +}; + +union Front front1; +union Front front2 = {};// expected-warning {{Initializing union 'Front' field 'i' only initializes the first

[PATCH] D80055: Diagnose union tail padding

2020-05-15 Thread JF Bastien via Phabricator via cfe-commits
jfb marked an inline comment as done. jfb added inline comments. Comment at: clang/include/clang/Basic/DiagnosticFrontendKinds.td:264 +def warn_union_tail_padding_uninitialized : Warning< + "Initializing union %0 field %1 only initializes the first %2 of %3 bytes, leaving the r

[PATCH] D80055: Diagnose union tail padding

2020-05-15 Thread JF Bastien via Phabricator via cfe-commits
jfb marked an inline comment as done. jfb added inline comments. Comment at: clang/include/clang/Basic/DiagnosticGroups.td:825 +def Padding : DiagGroup<"padding", [UnionTailPadding]>, + DiagCategory<"Padding Issue">; + I'd like to hear what other dia

[PATCH] D80055: Diagnose union tail padding

2020-05-15 Thread JF Bastien via Phabricator via cfe-commits
jfb marked an inline comment as done. jfb added inline comments. Comment at: clang/test/CodeGen/union-tail-padding.c:28-36 +union Front { + int i; + long long ll; +}; + +union Front front1; +union Front front2 = {};// expected-warning {{Initializing union 'Front' field

[PATCH] D80055: Diagnose union tail padding

2020-05-15 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added inline comments. Comment at: clang/test/CodeGen/union-tail-padding.c:28-36 +union Front { + int i; + long long ll; +}; + +union Front front1; +union Front front2 = {};// expected-warning {{Initializing union 'Front' field 'i' only initializes the first

[PATCH] D80055: Diagnose union tail padding

2020-05-15 Thread JF Bastien via Phabricator via cfe-commits
jfb marked an inline comment as done. jfb added inline comments. Comment at: clang/test/CodeGen/union-tail-padding.c:9 +// RUN: %clang_cc1 -Wunion-tail-padding -xc++ -std=c++17 -triple aarch64-apple-darwin %s -emit-llvm -o /dev/null -verify +// RUN: %clang_cc1 -Wunion-tail-paddi

[PATCH] D80055: Diagnose union tail padding

2020-05-15 Thread JF Bastien via Phabricator via cfe-commits
jfb created this revision. jfb added reviewers: rsmith, hubert.reinterpretcast. Herald added subscribers: cfe-commits, ributzka, dexonsmith, jkorous. Herald added a project: clang. jfb marked an inline comment as done. jfb added inline comments. Comment at: clang/test/CodeGen/uni