summaryrefslogtreecommitdiff
path: root/test/SemaCXX/zero-length-arrays.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/zero-length-arrays.cpp')
-rw-r--r--test/SemaCXX/zero-length-arrays.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/SemaCXX/zero-length-arrays.cpp b/test/SemaCXX/zero-length-arrays.cpp
index d86ab8666d53..cca883adc4b5 100644
--- a/test/SemaCXX/zero-length-arrays.cpp
+++ b/test/SemaCXX/zero-length-arrays.cpp
@@ -1,5 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-// expected-no-diagnostics
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
// <rdar://problem/10228639>
class Foo {
@@ -12,6 +13,9 @@ public:
class Bar {
int foo_count;
Foo foos[0];
+#if __cplusplus >= 201103L
+// expected-note@-2 {{copy constructor of 'Bar' is implicitly deleted because field 'foos' has an inaccessible copy constructor}}
+#endif
Foo foos2[0][2];
Foo foos3[2][0];
@@ -23,5 +27,10 @@ public:
void testBar() {
Bar b;
Bar b2(b);
+#if __cplusplus >= 201103L
+// expected-error@-2 {{call to implicitly-deleted copy constructor of 'Bar}}
+#else
+// expected-no-diagnostics
+#endif
b = b2;
}