| 1 |
//===----------------------------------------------------------------------===// |
| 2 |
// |
| 3 |
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 |
// See https://llvm.org/LICENSE.txt for license information. |
| 5 |
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 |
// |
| 7 |
//===----------------------------------------------------------------------===// |
| 8 |
|
| 9 |
// <memory> |
| 10 |
// UNSUPPORTED: c++03 |
| 11 |
|
| 12 |
// unique_ptr |
| 13 |
|
| 14 |
// test reset |
| 15 |
|
| 16 |
#include <memory> |
| 17 |
#include <cassert> |
| 18 |
|
| 19 |
#include "unique_ptr_test_helper.h" |
| 20 |
|
| 21 |
int main(int, char**) { |
| 22 |
{ |
| 23 |
std::unique_ptr<A[]> p; |
| 24 |
p.reset(static_cast<B*>(nullptr)); // expected-error {{no matching member function for call to 'reset'}} |
| 25 |
} |
| 26 |
{ |
| 27 |
std::unique_ptr<int[]> p; |
| 28 |
p.reset(static_cast<const int*>(nullptr)); // expected-error {{no matching member function for call to 'reset'}} |
| 29 |
} |
| 30 |
|
| 31 |
return 0; |
| 32 |
} |