//===----------------------------------------------------------------------===// // // 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 // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 // constexpr common_iterator(I i); #include #include #include "test_iterators.h" template constexpr bool test() { using CommonIt = std::common_iterator>; int a[] = {1,2,3}; It it = It(a); CommonIt lv = CommonIt(it); assert(&*lv == a); CommonIt rv = CommonIt(std::move(it)); assert(&*rv == a); return true; } int main(int, char**) { test>(); test>(); test>(); test>(); test>(); test(); test(); static_assert(test>()); static_assert(test>()); static_assert(test>()); static_assert(test>()); static_assert(test>()); static_assert(test()); static_assert(test()); return 0; }