brintos

brintos / llvm-project-archived public Read only

0
0
Text · 717 B · 0802ec7 Raw
36 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s3// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s4 5class Foo {6  ~Foo();7  Foo(const Foo&);8public:9  Foo(int);10};11 12class Bar {13  int foo_count;14  Foo foos[0];15#if __cplusplus >= 201103L16// expected-note@-2 {{copy constructor of 'Bar' is implicitly deleted because field 'foos' has an inaccessible copy constructor}}17#endif18  Foo foos2[0][2];19  Foo foos3[2][0];20 21public:22  Bar(): foo_count(0) { }    23  ~Bar() { }24};25 26void testBar() {27  Bar b;28  Bar b2(b);29#if __cplusplus >= 201103L30// expected-error@-2 {{call to implicitly-deleted copy constructor of 'Bar}}31#else32// expected-no-diagnostics33#endif34  b = b2;35}36