brintos

brintos / llvm-project-archived public Read only

0
0
Text · 849 B · 555c678 Raw
33 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// <memory>10// UNSUPPORTED: c++0311 12// unique_ptr13 14// test reset15 16#include <memory>17#include <cassert>18 19#include "unique_ptr_test_helper.h"20 21int 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}33