From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id BCAEE383982A; Wed, 16 Jun 2021 13:31:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BCAEE383982A MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r12-1536] libstdc++: Use named struct for __decay_copy X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: b9e35ee6d64bc9f82b8fe641aa8ac12a9e259fe8 X-Git-Newrev: c25e3bf87975280a603ff18fba387c6707ce4a95 Message-Id: <20210616133131.BCAEE383982A@sourceware.org> Date: Wed, 16 Jun 2021 13:31:31 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jun 2021 13:31:31 -0000 https://gcc.gnu.org/g:c25e3bf87975280a603ff18fba387c6707ce4a95 commit r12-1536-gc25e3bf87975280a603ff18fba387c6707ce4a95 Author: Jonathan Wakely Date: Wed Jun 16 12:47:32 2021 +0100 libstdc++: Use named struct for __decay_copy In r12-1486-gcb326a6442f09cb36b05ce556fc91e10bfeb0cf6 I changed __decay_copy to be a function object of unnamed class type. This causes problems when importing the library headers: error: conflicting global module declaration 'constexpr const std::ranges::__cust_access:: std::ranges::__cust_access::__decay_copy' The fix is to use a named struct instead of an anonymous one. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/iterator_concepts.h (__decay_copy): Name type. Diff: --- libstdc++-v3/include/bits/iterator_concepts.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/include/bits/iterator_concepts.h b/libstdc++-v3/include/bits/iterator_concepts.h index d18ae32bf20..11748e5ed7b 100644 --- a/libstdc++-v3/include/bits/iterator_concepts.h +++ b/libstdc++-v3/include/bits/iterator_concepts.h @@ -930,7 +930,8 @@ namespace ranges { using std::__detail::__class_or_enum; - struct { + struct _Decay_copy final + { template constexpr decay_t<_Tp> operator()(_Tp&& __t) const