diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td index 08b8f02460c16..9944fa87aba23 100644 --- a/clang/include/clang/Basic/DiagnosticGroups.td +++ b/clang/include/clang/Basic/DiagnosticGroups.td @@ -1060,7 +1060,7 @@ def Consumed : DiagGroup<"consumed">; // warning should be active _only_ when -Wall is passed in, mark it as // DefaultIgnore in addition to putting it here. def All : DiagGroup<"all", [Most, Parentheses, Switch, SwitchBool, - MisleadingIndentation]>; + MisleadingIndentation, PackedNonPod]>; // Warnings that should be in clang-cl /w4. def : DiagGroup<"CL4", [All, Extra]>; diff --git a/clang/test/CodeGenCXX/warn-padded-packed.cpp b/clang/test/CodeGenCXX/warn-all-padded-packed-packed-non-pod.cpp similarity index 93% rename from clang/test/CodeGenCXX/warn-padded-packed.cpp rename to clang/test/CodeGenCXX/warn-all-padded-packed-packed-non-pod.cpp index c51a6c9443f6e..5402e21e3a5b8 100644 --- a/clang/test/CodeGenCXX/warn-padded-packed.cpp +++ b/clang/test/CodeGenCXX/warn-all-padded-packed-packed-non-pod.cpp @@ -1,5 +1,10 @@ // RUN: %clang_cc1 -triple=x86_64-none-none -Wpadded -Wpacked -verify=expected,top %s -emit-llvm-only // RUN: %clang_cc1 -triple=x86_64-none-none -Wpadded -Wpacked -verify=expected,abi15 -fclang-abi-compat=15 %s -emit-llvm-only +// -Wpacked-non-pod itself should not emit the "packed attribute is unnecessary" warnings. +// RUN: %clang_cc1 -triple=x86_64-none-none -Wpacked-non-pod -verify=top %s -emit-llvm-only +// -Wall should not emit the "packed attribute is unnecessary" warnings without -Wpacked. +// RUN: %clang_cc1 -triple=x86_64-none-none -Wall -verify=top %s -emit-llvm-only + struct S1 { char c; diff --git a/clang/test/Misc/warning-wall.c b/clang/test/Misc/warning-wall.c index e57c5d6d501da..1c74759ce6161 100644 --- a/clang/test/Misc/warning-wall.c +++ b/clang/test/Misc/warning-wall.c @@ -99,6 +99,7 @@ CHECK-NEXT: -Wdangling-else CHECK-NEXT: -Wswitch CHECK-NEXT: -Wswitch-bool CHECK-NEXT: -Wmisleading-indentation +CHECK-NEXT: -Wpacked-non-pod CHECK-NOT:-W