[libcxx-commits] [libcxx] Fix error: '__outer_iterator' redeclared with 'public' access (PR #161859)

Yuriy Chernyshov via libcxx-commits libcxx-commits at lists.llvm.org
Fri Oct 3 08:07:31 PDT 2025


https://github.com/georgthegreat created https://github.com/llvm/llvm-project/pull/161859

Fixes the following compilation error:
```
$(SOURCE_ROOT)/contrib/libs/cxxsupp/libcxx/include/__ranges/lazy_split_view.h:143:10: error: '__outer_iterator' redeclared with 'public' access
  143 |   struct __outer_iterator : __outer_iterator_category<__maybe_const<_Const, _View>> {
      |          ^
$(SOURCE_ROOT)/contrib/libs/cxxsupp/libcxx/include/__ranges/lazy_split_view.h:79:10: note: previously declared 'private' here
   79 |   struct __outer_iterator;
```

>From 320e0e1af3fd7e2a1e8212d272c4c64dca087256 Mon Sep 17 00:00:00 2001
From: Yuriy Chernyshov <thegeorg at yandex-team.com>
Date: Fri, 3 Oct 2025 17:07:16 +0200
Subject: [PATCH] Fix error: '__outer_iterator' redeclared with 'public' access

Fixes the following compilation error:
```
$(SOURCE_ROOT)/contrib/libs/cxxsupp/libcxx/include/__ranges/lazy_split_view.h:143:10: error: '__outer_iterator' redeclared with 'public' access
  143 |   struct __outer_iterator : __outer_iterator_category<__maybe_const<_Const, _View>> {
      |          ^
$(SOURCE_ROOT)/contrib/libs/cxxsupp/libcxx/include/__ranges/lazy_split_view.h:79:10: note: previously declared 'private' here
   79 |   struct __outer_iterator;
```
---
 libcxx/include/__ranges/lazy_split_view.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libcxx/include/__ranges/lazy_split_view.h b/libcxx/include/__ranges/lazy_split_view.h
index cca9191d26818..7471579653d20 100644
--- a/libcxx/include/__ranges/lazy_split_view.h
+++ b/libcxx/include/__ranges/lazy_split_view.h
@@ -76,6 +76,7 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
       _If<!forward_range<_View>, __non_propagating_cache<iterator_t<_View>>, __empty_cache>;
   _LIBCPP_NO_UNIQUE_ADDRESS _MaybeCurrent __current_ = _MaybeCurrent();
 
+private:
   template <bool>
   struct __outer_iterator;
   template <bool>



More information about the libcxx-commits mailing list