llvm/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.verify.cpp

//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

// <memory>

// unique_ptr

// test op->()

#include <memory>

struct V {
  int member;
};

void f() {
  std::unique_ptr<V[]> p;
  std::unique_ptr<V[]> const& cp = p;

  p->member; // expected-error-re {{member reference type 'std::unique_ptr<V{{[ ]*}}[]>' is not a pointer}}
             // expected-error@-1 {{no member named 'member'}}

  cp->member; // expected-error-re {{member reference type 'const std::unique_ptr<V{{[ ]*}}[]>' is not a pointer}}
              // expected-error@-1 {{no member named 'member'}}
}