Relax the non-POD memset warning to use the less restrictive C++11
definition of POD. Specifically, this allows certain non-aggregate
types due to their data members being private.
The representation of C++11 POD testing is pretty gross. Any suggestions
for improvements there are welcome. Especially the name
'isCXX11PODType()' seems truly unfortunate.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130492 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/warn-non-pod-memset.cpp b/test/SemaCXX/warn-non-pod-memset.cpp
index 97bbdc2..1ca7149 100644
--- a/test/SemaCXX/warn-non-pod-memset.cpp
+++ b/test/SemaCXX/warn-non-pod-memset.cpp
@@ -7,6 +7,14 @@
struct S2 { int x; } s2;
struct S3 { float x, y; S1 s[4]; void (*f)(S1**); } s3;
+// We use the C++11 concept of POD for this warning, so ensure a non-aggregate
+// still warns.
+class C1 {
+ int x, y, z;
+public:
+ void foo() {}
+} c1;
+
// Non-POD types that should warn.
struct X1 { X1(); } x1;
struct X2 { ~X2(); } x2;
@@ -45,6 +53,7 @@
memset(&s1, 0, sizeof s1);
memset(&s2, 0, sizeof s2);
memset(&s3, 0, sizeof s3);
+ memset(&c1, 0, sizeof c1);
// Unevaluated code shouldn't warn.
(void)sizeof memset(&x1, 0, sizeof x1);