From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 67F323858C2C; Wed, 2 Feb 2022 17:37:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 67F323858C2C 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-7003] libstdc++: Fix link failure in _OutputIteratorConcept X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 9a92e46c0e9a75cd14125493b8826d3e33dd0f67 X-Git-Newrev: b229c5186093fa6603030ae83d5fe640ef7051a4 Message-Id: <20220202173714.67F323858C2C@sourceware.org> Date: Wed, 2 Feb 2022 17:37:14 +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, 02 Feb 2022 17:37:14 -0000 https://gcc.gnu.org/g:b229c5186093fa6603030ae83d5fe640ef7051a4 commit r12-7003-gb229c5186093fa6603030ae83d5fe640ef7051a4 Author: Jonathan Wakely Date: Tue Jan 25 21:29:31 2022 +0000 libstdc++: Fix link failure in _OutputIteratorConcept The C++98-style concept check for output iterators causes a link failure on mingw-w64, because the __val() member function isn't defined. Change it to use a function pointer instead. That pointer is never set to anything meaningful, but it doesn't matter as the __constraints() function only has to be instantiated, it's never called. We could refactor all of these to use unevaluated contexts (e.g. sizeof of __decltype) so that we only check the expressions are well-formed, without any codegen at all. Any improvements to these are very low priority though. libstdc++-v3/ChangeLog: * include/bits/boost_concept_check.h (_OutputIteratorConcept): Change member function to data member of function pointer type. Diff: --- libstdc++-v3/include/bits/boost_concept_check.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/include/bits/boost_concept_check.h b/libstdc++-v3/include/bits/boost_concept_check.h index 23dba067693..3d884eb440f 100644 --- a/libstdc++-v3/include/bits/boost_concept_check.h +++ b/libstdc++-v3/include/bits/boost_concept_check.h @@ -483,7 +483,9 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; *__i++ = __val(); // require postincrement and assignment } _Tp __i; - _ValueT __val() const; + // Use a function pointer here so no definition of the function needed. + // Just need something that returns a _ValueT (which might be a reference). + _ValueT (*__val)(); }; template