[CodeGen] Remove some implict conversions of MCRegister to unsigned by using(). NFC
[llvm-project.git] / libcxx / test / std / re / re.results / re.results.const / default.pass.cpp
blobbcb2462610ee1749b78696dbfad50149ad753738
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 //===----------------------------------------------------------------------===//
9 // <regex>
11 // class match_results<BidirectionalIterator, Allocator>
13 // explicit match_results(const Allocator& a = Allocator()); // before C++20
14 // match_results() : match_results(Allocator()) {} // C++20
15 // explicit match_results(const Allocator& a); // C++20
17 #include <regex>
18 #include <cassert>
19 #include "test_macros.h"
20 #if TEST_STD_VER >= 11
21 #include "test_convertible.h"
23 template <typename T>
24 void test_implicit() {
25 static_assert(test_convertible<T>(), "");
26 static_assert(!test_convertible<T, typename T::allocator_type>(), "");
28 #endif
30 template <class CharT>
31 void
32 test()
34 typedef std::match_results<const CharT*> M;
35 typedef std::allocator<std::sub_match<const CharT*> > Alloc;
36 M m;
37 assert(m.size() == 0);
38 assert(!m.ready());
39 assert(m.get_allocator() == Alloc());
41 #if TEST_STD_VER >= 11
42 test_implicit<M>();
43 #endif
46 int main(int, char**)
48 test<char>();
49 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
50 test<wchar_t>();
51 #endif
53 return 0;