| 1 |
// { dg-do compile { target c++11 } } |
| 2 |
// { dg-require-effective-target hosted } |
| 3 |
|
| 4 |
#include <memory> |
| 5 |
#include <testsuite_tr1.h> |
| 6 |
|
| 7 |
using namespace __gnu_test; |
| 8 |
|
| 9 |
void |
| 10 |
test01() |
| 11 |
{ |
| 12 |
std::shared_ptr<ClassType> ptr; |
| 13 |
std::shared_ptr<const ClassType> ptr2 = ptr; |
| 14 |
|
| 15 |
#if __cpp_lib_shared_ptr_arrays >= 201611L |
| 16 |
std::shared_ptr<ClassType[10]> ptr_array; |
| 17 |
std::shared_ptr<ClassType[]> ptr_array2 = ptr_array; |
| 18 |
std::shared_ptr<ClassType const []> ptr_array3 = ptr_array; |
| 19 |
#endif |
| 20 |
} |
| 21 |
|
| 22 |
void |
| 23 |
test02() |
| 24 |
{ |
| 25 |
std::shared_ptr<IncompleteClass> ptr; |
| 26 |
std::shared_ptr<const IncompleteClass> ptr2 = ptr; |
| 27 |
|
| 28 |
#if __cpp_lib_shared_ptr_arrays >= 201611L |
| 29 |
std::shared_ptr<IncompleteClass[10]> ptr_array; |
| 30 |
std::shared_ptr<IncompleteClass[]> ptr_array2 = ptr_array; |
| 31 |
std::shared_ptr<IncompleteClass const []> ptr_array3 = ptr_array; |
| 32 |
#endif |
| 33 |
} |