blob: 109c583f070cc419ad9f180e2a94600ef37fa719 [file] [log] [blame]
Howard Hinnant3e519522010-05-11 19:42:16 +00001//===----------------------------------------------------------------------===//
2//
Howard Hinnant5b08a8a2010-05-11 21:36:01 +00003// The LLVM Compiler Infrastructure
Howard Hinnant3e519522010-05-11 19:42:16 +00004//
Howard Hinnant412dbeb2010-11-16 22:09:02 +00005// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
Howard Hinnant3e519522010-05-11 19:42:16 +00007//
8//===----------------------------------------------------------------------===//
9
10// <string>
11
12// const_reverse_iterator crend() const;
13
14#include <string>
15#include <cassert>
16
Howard Hinnanteec72182013-06-28 16:59:19 +000017#include "../min_allocator.h"
18
Howard Hinnant3e519522010-05-11 19:42:16 +000019template <class S>
20void
21test(const S& s)
22{
23 typename S::const_reverse_iterator ce = s.crend();
24 assert(ce == s.rend());
25}
26
27int main()
28{
Howard Hinnanteec72182013-06-28 16:59:19 +000029 {
Howard Hinnant3e519522010-05-11 19:42:16 +000030 typedef std::string S;
31 test(S());
32 test(S("123"));
Howard Hinnanteec72182013-06-28 16:59:19 +000033 }
34#if __cplusplus >= 201103L
35 {
36 typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
37 test(S());
38 test(S("123"));
39 }
40#endif
Howard Hinnant3e519522010-05-11 19:42:16 +000041}