diff options
author | dim <dim@FreeBSD.org> | 2015-05-27 18:47:56 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-05-27 18:47:56 +0000 |
commit | 3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65 (patch) | |
tree | dbbd4047878da71c1a706e26ce05b4e7791b14cc /test/SemaCXX/deleted-function.cpp | |
parent | 38d6f2e7f2ce51a5b3836d26596c6c34a3288752 (diff) | |
download | FreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.zip FreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.tar.gz |
Vendor import of clang trunk r238337:
https://llvm.org/svn/llvm-project/cfe/trunk@238337
Diffstat (limited to 'test/SemaCXX/deleted-function.cpp')
-rw-r--r-- | test/SemaCXX/deleted-function.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/SemaCXX/deleted-function.cpp b/test/SemaCXX/deleted-function.cpp index d7ef9b2..bd6fc09 100644 --- a/test/SemaCXX/deleted-function.cpp +++ b/test/SemaCXX/deleted-function.cpp @@ -65,3 +65,31 @@ template void test3<int>(); void test4() {} // expected-note {{previous definition is here}} void test4() = delete; // expected-error {{redefinition of 'test4'}} + +struct DelCtor { // expected-note 4{{implicit}} + DelCtor(int) = delete; // expected-note 14{{deleted}} + // ensure the class is not an aggregate + DelCtor(int, int, int, int); +}; +DelCtor dc1 = 0; // expected-error {{deleted}} +DelCtor dc2(0); // expected-error {{deleted}} +DelCtor dc3 = {0}; // expected-error {{deleted}} +DelCtor dc4{0}; // expected-error {{deleted}} +DelCtor dc5 = (DelCtor)0; // expected-error {{deleted}} +DelCtor dc6 = DelCtor(0); // expected-error {{deleted}} +DelCtor dc7 = DelCtor{0}; // expected-error {{deleted}} +DelCtor *dc8 = new DelCtor(0); // expected-error {{deleted}} +DelCtor *dc9 = new DelCtor{0}; // expected-error {{deleted}} +DelCtor dc10[] = {0}; // expected-error {{deleted}} +int use_dc(DelCtor); // expected-note 2{{here}} +int dc11 = use_dc(0); // expected-error {{deleted}} +int dc12 = use_dc({0}); // expected-error {{deleted}} +int use_dcr(const DelCtor &); // expected-note {{here}} +int dc13 = use_dcr(0); // expected-error {{deleted}} +int dc14 = use_dcr({0}); // expected-error {{deleted}} + +struct DelCtorTemplate { + template<typename T> DelCtorTemplate(T) = delete; // expected-note {{deleted}} +}; +int use_dct(const DelCtorTemplate &); +int dc15 = use_dct(0); // expected-error {{deleted}} |