diff options
Diffstat (limited to 'libcxx/test/std/utilities/memory')
| -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; { |

