[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / std / iterators / iterator.primitives / iterator.traits / empty.pass.cpp
blobb9917e5a518624aa945bdc794b4606bc9d2ef9b5
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 // <iterator>
11 // template<class NotAnIterator>
12 // struct iterator_traits
13 // {
14 // };
16 #include <iterator>
18 #include "test_macros.h"
20 struct not_an_iterator
24 template <class T>
25 struct has_value_type
27 private:
28 struct two {char lx; char lxx;};
29 template <class U> static two test(...);
30 template <class U> static char test(typename U::value_type* = 0);
31 public:
32 static const bool value = sizeof(test<T>(0)) == 1;
35 int main(int, char**)
37 typedef std::iterator_traits<not_an_iterator> It;
38 static_assert(!(has_value_type<It>::value), "");
40 return 0;