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 
11 // unique_ptr
12 
13 // test reset
14 
15 #include <memory>
16 #include <cassert>
17 
18 #include "unique_ptr_test_helper.h"
19 
20 int main(int, char**) {
21   {
22     std::unique_ptr<A[]> p;
23     p.reset(static_cast<B*>(nullptr)); // expected-error {{no matching member function for call to 'reset'}}
24   }
25   {
26     std::unique_ptr<int[]> p;
27     p.reset(static_cast<const int*>(nullptr)); // expected-error {{no matching member function for call to 'reset'}}
28   }
29 
30   return 0;
31 }
32