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 #include <cassert> 17 18 struct V { 19 int member; 20 }; 21 22 int main(int, char**) { 23 std::unique_ptr<V[]> p; 24 std::unique_ptr<V[]> const& cp = p; 25 26 p->member; // expected-error-re {{member reference type 'std::unique_ptr<V{{[ ]*}}[]>' is not a pointer}} 27 // expected-error@-1 {{no member named 'member'}} 28 29 cp->member; // expected-error-re {{member reference type 'const std::unique_ptr<V{{[ ]*}}[]>' is not a pointer}} 30 // expected-error@-1 {{no member named 'member'}} 31 32 return 0; 33 } 34