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 | cd6ed54fedd042d301b19b484ceb14b7d83b3ede (patch) | |
tree | e2072cb37cf36f6141fb187951f44e9b0cc12d00 /test | |
parent | 73f131f21076c5d10851cfdcbad2c52856c073a5 (diff) | |
download | external_libcxx-cd6ed54fedd042d301b19b484ceb14b7d83b3ede.tar.gz external_libcxx-cd6ed54fedd042d301b19b484ceb14b7d83b3ede.tar.bz2 external_libcxx-cd6ed54fedd042d301b19b484ceb14b7d83b3ede.zip |
Make sure that __libcpp_compressed_pair_imp default-constructs its' members, rather than value-initializing them. Fixes PR#24137
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242377 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | 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/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp index 5dfa4cd66..8cb972b0c 100644 --- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp +++ b/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; { |