2011-11-03 07:04:16 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
2017-02-25 06:22:05 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
|
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
|
2011-11-03 07:04:16 +08:00
|
|
|
|
|
|
|
// <rdar://problem/10228639>
|
|
|
|
class Foo {
|
|
|
|
~Foo();
|
|
|
|
Foo(const Foo&);
|
|
|
|
public:
|
|
|
|
Foo(int);
|
|
|
|
};
|
|
|
|
|
|
|
|
class Bar {
|
|
|
|
int foo_count;
|
|
|
|
Foo foos[0];
|
2017-02-25 06:22:05 +08:00
|
|
|
#if __cplusplus >= 201103L
|
|
|
|
// expected-note@-2 {{copy constructor of 'Bar' is implicitly deleted because field 'foos' has an inaccessible copy constructor}}
|
|
|
|
#endif
|
2011-11-03 07:04:16 +08:00
|
|
|
Foo foos2[0][2];
|
|
|
|
Foo foos3[2][0];
|
|
|
|
|
|
|
|
public:
|
|
|
|
Bar(): foo_count(0) { }
|
|
|
|
~Bar() { }
|
|
|
|
};
|
|
|
|
|
|
|
|
void testBar() {
|
|
|
|
Bar b;
|
|
|
|
Bar b2(b);
|
2017-02-25 06:22:05 +08:00
|
|
|
#if __cplusplus >= 201103L
|
|
|
|
// expected-error@-2 {{call to implicitly-deleted copy constructor of 'Bar}}
|
|
|
|
#else
|
|
|
|
// expected-no-diagnostics
|
|
|
|
#endif
|
2011-11-03 07:04:16 +08:00
|
|
|
b = b2;
|
|
|
|
}
|