[libcxx-commits] [libcxx] [libcxx] adds ranges::fold_left_with_iter and ranges::fold_left (PR #75259)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Dec 14 15:37:39 PST 2023


================
@@ -0,0 +1,203 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// <algorithm>
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
+
+// Checks that `std::ranges::fold_left_with_iter`'s requirements are correct.
+
+#include <algorithm>
+#include <concepts>
+#include <functional>
+#include <iterator>
+#include <ranges>
+
+#include "test_range.h"
+#include "test_iterators.h"
+#include "../requirements.h"
+
+// expected-error@*:* 19 {{no matching function for call to object of type 'const __fold_left_with_iter'}}
+
+void test_iterator() {
----------------
EricWF wrote:

This test is very fragile and will break anytime even the slightest bit of the diagnostic changes.

Also the notes are so loosely coupled to source lines or instantiations it's unclear if they actually attach to the code they're next to.

Consider deleting this test entirely. 

https://github.com/llvm/llvm-project/pull/75259


More information about the libcxx-commits mailing list