diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2015-07-16 03:05:06 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2015-07-16 03:05:06 +0000 |
| commit | 05fc0f25d67a815d822ac3139e5c74110280600a (patch) | |
| tree | 3c9e8ccde6e599e6e7d8962ab317ccd9ae62bbc0 /libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared | |
| parent | 041e6deb2c8bd7391aac9ae329cb3184cbdc9318 (diff) | |
| download | bcm5719-llvm-05fc0f25d67a815d822ac3139e5c74110280600a.tar.gz bcm5719-llvm-05fc0f25d67a815d822ac3139e5c74110280600a.zip | |
Make sure that __libcpp_compressed_pair_imp default-constructs its' members, rather than value-initializing them. Fixes PR#24137
llvm-svn: 242377
Diffstat (limited to 'libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared')
| -rw-r--r-- | libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp index 5dfa4cd66bc..8cb972b0c1a 100644 --- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp +++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp @@ -37,6 +37,14 @@ private: int A::count = 0; + +struct Foo +{ + Foo() = default; + virtual ~Foo() = default; +}; + + int main() { int nc = globalMemCounter.outstanding_new; @@ -49,6 +57,14 @@ int main() assert(p->get_int() == 67); assert(p->get_char() == 'e'); } + + { // https://llvm.org/bugs/show_bug.cgi?id=24137 + std::shared_ptr<Foo> p1 = std::make_shared<Foo>(); + assert(p1.get()); + std::shared_ptr<const Foo> p2 = std::make_shared<const Foo>(); + assert(p2.get()); + } + #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES nc = globalMemCounter.outstanding_new; { |

