Louis Dionne 4537bda929 [libc++][NFC] Change some std::pair tests from .compile.fail.cpp to .verify.cpp
Those tests are arguably not great anyways, but it's better to have
then as .verify tests than compile failure tests, which are too brittle.
2023-02-11 09:43:01 -08:00

21 lines
665 B
C++

//===----------------------------------------------------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//
// <utility>
// template <class T1, class T2> struct pair
// tuple_element<I, pair<T1, T2> >::type
#include <utility>
void f() {
typedef std::pair<int, short> T;
std::tuple_element<2, T>::type foo; // expected-error@*:* {{Index out of bounds in std::tuple_element<std::pair<T1, T2>>}}
}