diff options
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 |

