From 9df8ba631d4612eb8f930c9fe7c6cf39e5deb3af Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Mon, 21 Nov 2022 23:59:21 +0000 Subject: [PATCH] pr59000: Clarify packed-non-pod warning that it's pod-for-the-purposes-of-layout --- clang/include/clang/Basic/DiagnosticASTKinds.td | 7 +++++-- clang/test/CodeGenCXX/warn-padded-packed.cpp | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/clang/include/clang/Basic/DiagnosticASTKinds.td b/clang/include/clang/Basic/DiagnosticASTKinds.td index 15bd9d7..6a2d15e 100644 --- a/clang/include/clang/Basic/DiagnosticASTKinds.td +++ b/clang/include/clang/Basic/DiagnosticASTKinds.td @@ -960,8 +960,11 @@ def warn_padded_struct_size : Warning< InGroup, DefaultIgnore; def warn_unnecessary_packed : Warning< "packed attribute is unnecessary for %0">, InGroup, DefaultIgnore; -def warn_unpacked_field : Warning< - "not packing field %0 as it is non-POD">, InGroup, DefaultIgnore; +def warn_unpacked_field + : Warning< + "not packing field %0 as it is non-POD for the purposes of layout">, + InGroup, + DefaultIgnore; // -Wunaligned-access def warn_unaligned_access : Warning< diff --git a/clang/test/CodeGenCXX/warn-padded-packed.cpp b/clang/test/CodeGenCXX/warn-padded-packed.cpp index 60cf5e4..cf4890e 100644 --- a/clang/test/CodeGenCXX/warn-padded-packed.cpp +++ b/clang/test/CodeGenCXX/warn-padded-packed.cpp @@ -154,7 +154,7 @@ struct S28 { char c1; short s1; char c2; - S28_non_pod p1; // expected-warning {{not packing field 'p1' as it is non-POD}} + S28_non_pod p1; // expected-warning {{not packing field 'p1' as it is non-POD for the purposes of layout}} } __attribute__((packed)); struct S29_non_pod_align_1 { -- 2.7.4