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 against resetting self
14 
15 #include <memory>
16 
17 struct A {
18   std::unique_ptr<A> ptr_;
19 
20   A() : ptr_(this) {}
21   void reset() { ptr_.reset(); }
22 };
23 
24 int main(int, char**) { (new A)->reset();
25   return 0;
26 }
27