Skip to content

Commit 9df8ba6

Browse files
committed
pr59000: Clarify packed-non-pod warning that it's pod-for-the-purposes-of-layout
1 parent 2b1e895 commit 9df8ba6

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

clang/include/clang/Basic/DiagnosticASTKinds.td

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,8 +960,11 @@ def warn_padded_struct_size : Warning<
960960
InGroup<Padded>, DefaultIgnore;
961961
def warn_unnecessary_packed : Warning<
962962
"packed attribute is unnecessary for %0">, InGroup<Packed>, DefaultIgnore;
963-
def warn_unpacked_field : Warning<
964-
"not packing field %0 as it is non-POD">, InGroup<PackedNonPod>, DefaultIgnore;
963+
def warn_unpacked_field
964+
: Warning<
965+
"not packing field %0 as it is non-POD for the purposes of layout">,
966+
InGroup<PackedNonPod>,
967+
DefaultIgnore;
965968

966969
// -Wunaligned-access
967970
def warn_unaligned_access : Warning<

clang/test/CodeGenCXX/warn-padded-packed.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ struct S28 {
154154
char c1;
155155
short s1;
156156
char c2;
157-
S28_non_pod p1; // expected-warning {{not packing field 'p1' as it is non-POD}}
157+
S28_non_pod p1; // expected-warning {{not packing field 'p1' as it is non-POD for the purposes of layout}}
158158
} __attribute__((packed));
159159

160160
struct S29_non_pod_align_1 {

0 commit comments

Comments
 (0)