diff options
author | dim <dim@FreeBSD.org> | 2011-06-12 15:46:16 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-06-12 15:46:16 +0000 |
commit | c49018d9cce52d8c9f34b44865ec3ba8e89a1488 (patch) | |
tree | c5e9e10bc189de0058aa763c47b9920a8351b7df /test/SemaCXX/cxx0x-delegating-ctors.cpp | |
parent | 110eaaceddcec790f7e6a5e3bf1261c9aa1e73ab (diff) | |
download | FreeBSD-src-c49018d9cce52d8c9f34b44865ec3ba8e89a1488.zip FreeBSD-src-c49018d9cce52d8c9f34b44865ec3ba8e89a1488.tar.gz |
Vendor import of clang trunk r132879:
http://llvm.org/svn/llvm-project/cfe/trunk@132879
Diffstat (limited to 'test/SemaCXX/cxx0x-delegating-ctors.cpp')
-rw-r--r-- | test/SemaCXX/cxx0x-delegating-ctors.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/test/SemaCXX/cxx0x-delegating-ctors.cpp b/test/SemaCXX/cxx0x-delegating-ctors.cpp index b211cb1..a3e6ff3 100644 --- a/test/SemaCXX/cxx0x-delegating-ctors.cpp +++ b/test/SemaCXX/cxx0x-delegating-ctors.cpp @@ -7,8 +7,9 @@ struct foo { foo(int, int); foo(bool); foo(char); - foo(float*); - foo(float&); + foo(const float*); + foo(const float&); + foo(void*); }; // Good @@ -21,16 +22,27 @@ foo::foo () : foo(-1) { foo::foo (int, int) : foo() { } -foo::foo (bool) : foo(true) { // expected-error{{delegates to itself}} +foo::foo (bool) : foo(true) { // expected-error{{creates a delegation cycle}} } // Good -foo::foo (float* f) : foo(*f) { +foo::foo (const float* f) : foo(*f) { // expected-note{{it delegates to}} } -// FIXME: This should error -foo::foo (float &f) : foo(&f) { +foo::foo (const float &f) : foo(&f) { //expected-error{{creates a delegation cycle}} \ + //expected-note{{which delegates to}} } foo::foo (char) : i(3), foo(3) { // expected-error{{must appear alone}} } + +// This should not cause an infinite loop +foo::foo (void*) : foo(4.0f) { +} + +struct deleted_dtor { + ~deleted_dtor() = delete; // expected-note{{function has been explicitly marked deleted here}} + deleted_dtor(); + deleted_dtor(int) : deleted_dtor() // expected-error{{attempt to use a deleted function}} + {} +}; |