brintos

brintos / llvm-project-archived public Read only

0
0
Text · 733 B · a920c69 Raw
24 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// <utility>10 11// template <class T1, class T2> struct pair12 13// template<size_t I, class T1, class T2>14//     const typename tuple_element<I, std::pair<T1, T2> >::type&15//     get(const pair<T1, T2>&);16 17#include <utility>18 19void f() {20  typedef std::pair<int, short> P;21  const P p(3, 4);22  std::get<0>(p) = 5; // expected-error {{cannot assign to return value}}23}24