aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/warn-bad-memaccess.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/warn-bad-memaccess.cpp')
-rw-r--r--test/SemaCXX/warn-bad-memaccess.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/SemaCXX/warn-bad-memaccess.cpp b/test/SemaCXX/warn-bad-memaccess.cpp
index e86610ab64d9..67cde10bf45d 100644
--- a/test/SemaCXX/warn-bad-memaccess.cpp
+++ b/test/SemaCXX/warn-bad-memaccess.cpp
@@ -21,7 +21,7 @@ public:
void foo() {}
} c1;
-struct X1 { virtual void f(); } x1;
+struct X1 { virtual void f(); } x1, x1arr[2];
struct X2 : virtual S1 {} x2;
struct ContainsDynamic { X1 dynamic; } contains_dynamic;
@@ -33,6 +33,10 @@ void test_warn() {
memset(&x1, 0, sizeof x1); // \
// expected-warning {{destination for this 'memset' call is a pointer to dynamic class}} \
// expected-note {{explicitly cast the pointer to silence this warning}}
+ memset(x1arr, 0, sizeof x1arr); // \
+ // expected-warning {{destination for this 'memset' call is a pointer to dynamic class}} \
+ // expected-note {{explicitly cast the pointer to silence this warning}}
+ memset((void*)x1arr, 0, sizeof x1arr);
memset(&x2, 0, sizeof x2); // \
// expected-warning {{destination for this 'memset' call is a pointer to dynamic class}} \
// expected-note {{explicitly cast the pointer to silence this warning}}