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 op->()
14
15#include <memory>
16
17struct V {
18 int member;
19};
20
21void f() {
22 std::unique_ptr<V[]> p;
23 std::unique_ptr<V[]> const& cp = p;
24
25 p->member; // expected-error-re {{member reference type 'std::unique_ptr<V{{[ ]*}}[]>' is not a pointer}}
26 // expected-error@-1 {{no member named 'member'}}
27
28 cp->member; // expected-error-re {{member reference type 'const std::unique_ptr<V{{[ ]*}}[]>' is not a pointer}}
29 // expected-error@-1 {{no member named 'member'}}
30}
31

source code of libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.verify.cpp