diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2015-12-07 16:11:54 -0600 |
---|---|---|
committer | Patrick Williams <iawillia@us.ibm.com> | 2015-12-11 15:30:27 -0600 |
commit | 6aab5b3a5300c63bbbfeecf243c8fb2bd6bd0681 (patch) | |
tree | f68674323300ca7f2ff3eb0a945fc7bef45f210e /src | |
parent | e95f1b15004d7c0c53673f879a99bf0e1ae9cd97 (diff) | |
download | blackbird-hostboot-6aab5b3a5300c63bbbfeecf243c8fb2bd6bd0681.tar.gz blackbird-hostboot-6aab5b3a5300c63bbbfeecf243c8fb2bd6bd0681.zip |
shared_ptr r-value ref ctor didn't match standard
Change-Id: I4825be8ff9929eadc3ee78d2141f6a3d43ea751b
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/22518
Reviewed-by: Christian Geddes <crgeddes@us.ibm.com>
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/include/util/impl/shared_ptr.H | 4 | ||||
-rw-r--r-- | src/usr/testcore/lib/shared_ptr.H | 16 |
2 files changed, 18 insertions, 2 deletions
diff --git a/src/include/util/impl/shared_ptr.H b/src/include/util/impl/shared_ptr.H index 4530b5acf..a6cca17e5 100644 --- a/src/include/util/impl/shared_ptr.H +++ b/src/include/util/impl/shared_ptr.H @@ -93,14 +93,14 @@ namespace std return *this; } - shared_ptr& operator=(const shared_ptr&& r) + shared_ptr& operator=(shared_ptr&& r) { _cleanup(); _swap(std::move(r)); return *this; } - template<typename U> shared_ptr& operator=(const shared_ptr<U>&& r) + template<typename U> shared_ptr& operator=(shared_ptr<U>&& r) { _cleanup(); _swap(std::move(r)); diff --git a/src/usr/testcore/lib/shared_ptr.H b/src/usr/testcore/lib/shared_ptr.H index 0df164dff..17701b4f3 100644 --- a/src/usr/testcore/lib/shared_ptr.H +++ b/src/usr/testcore/lib/shared_ptr.H @@ -40,6 +40,16 @@ struct __STLSharedPtrTester2 : __STLSharedPtrTester using __STLSharedPtrTester::__STLSharedPtrTester; }; +struct __STLSharedPtrTester3 +{ + std::shared_ptr<uint8_t> foo; + + explicit __STLSharedPtrTester3(size_t i) + { + foo = std::shared_ptr<uint8_t>(new uint8_t[i]()); + } +}; + class STLSharedPtrTest : public CxxTest::TestSuite { public: @@ -84,6 +94,12 @@ class STLSharedPtrTest : public CxxTest::TestSuite TS_FAIL("p4 is not unique after p3.reset."); } } + + void testSharedPtr_Compile1() + { + // This was a compile issue for the FAPI2 code. + __STLSharedPtrTester3 foo(10); + } }; #endif |