12561885fSEric Fiselier //===----------------------------------------------------------------------===//
22561885fSEric Fiselier //
357b08b09SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
457b08b09SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
557b08b09SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
62561885fSEric Fiselier //
72561885fSEric Fiselier //===----------------------------------------------------------------------===//
82561885fSEric Fiselier 
92561885fSEric Fiselier // <memory>
102561885fSEric Fiselier 
112561885fSEric Fiselier // unique_ptr
122561885fSEric Fiselier 
132561885fSEric Fiselier // test op[](size_t)
142561885fSEric Fiselier 
152561885fSEric Fiselier #include <memory>
162561885fSEric Fiselier #include <cassert>
172561885fSEric Fiselier 
main(int,char **)18*2df59c50SJF Bastien int main(int, char**) {
192561885fSEric Fiselier   std::unique_ptr<int> p(new int[3]);
202561885fSEric Fiselier   std::unique_ptr<int> const& cp = p;
212561885fSEric Fiselier   p[0];  // expected-error {{type 'std::unique_ptr<int>' does not provide a subscript operator}}
222561885fSEric Fiselier   cp[1]; // expected-error {{type 'const std::unique_ptr<int>' does not provide a subscript operator}}
23*2df59c50SJF Bastien 
24*2df59c50SJF Bastien   return 0;
252561885fSEric Fiselier }
26