[clang] 9df8ba6 - pr59000: Clarify packed-non-pod warning that it's pod-for-the-purposes-of-layout

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 21 16:03:05 PST 2022


Author: David Blaikie
Date: 2022-11-22T00:02:09Z
New Revision: 9df8ba631d4612eb8f930c9fe7c6cf39e5deb3af

URL: https://github.com/llvm/llvm-project/commit/9df8ba631d4612eb8f930c9fe7c6cf39e5deb3af
DIFF: https://github.com/llvm/llvm-project/commit/9df8ba631d4612eb8f930c9fe7c6cf39e5deb3af.diff

LOG: pr59000: Clarify packed-non-pod warning that it's pod-for-the-purposes-of-layout

Added: 
    

Modified: 
    clang/include/clang/Basic/DiagnosticASTKinds.td
    clang/test/CodeGenCXX/warn-padded-packed.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Basic/DiagnosticASTKinds.td b/clang/include/clang/Basic/DiagnosticASTKinds.td
index 15bd9d7c0e49a..6a2d15ef77c6a 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<Padded>, DefaultIgnore;
 def warn_unnecessary_packed : Warning<
   "packed attribute is unnecessary for %0">, InGroup<Packed>, DefaultIgnore;
-def warn_unpacked_field : Warning<
-  "not packing field %0 as it is non-POD">, InGroup<PackedNonPod>, DefaultIgnore;
+def warn_unpacked_field
+    : Warning<
+          "not packing field %0 as it is non-POD for the purposes of layout">,
+      InGroup<PackedNonPod>,
+      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 60cf5e4a691f7..cf4890e40005d 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 {


        


More information about the cfe-commits mailing list