Home | History | Annotate | Download | only in unique.ptr.modifiers
      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 // <memory>
     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() {
     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