From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DC7AF3842423; Thu, 5 Nov 2020 18:01:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DC7AF3842423 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/97729] [11 Regression] Link failure due to basic_stringbuf and others when building DLL on MinGW Date: Thu, 05 Nov 2020 18:01:38 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: build X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Nov 2020 18:01:39 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97729 --- Comment #7 from CVS Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:710508c7b1a2c8e1d75d4c4f1ac79473dbf2b2bb commit r11-4749-g710508c7b1a2c8e1d75d4c4f1ac79473dbf2b2bb Author: Jonathan Wakely Date: Thu Nov 5 16:19:15 2020 +0000 libstdc++: Fix multiple definitions of std::exception_ptr functions [PR 97729] This fixes some multiple definition errors caused by the changes for PR libstdc++/90295. The previous solution for inlining the members of std::exception_ptr but still exporting them from the library was to suppress the 'inline' keyword on those functions when compiling libsupc++/eh_ptr.cc, so they get defined in that file. That produces ODR violations though, because there are now both inline and non-inline definitions in the library, due to the use of std::exception_ptr in other files sucg as src/c++11/future.cc. The new solution is to define all the relevant members as 'inline' unconditionally, but use __attribute__((used)) to cause definitions to be emitted in libsupc++/eh_ptr.cc as before. This doesn't quite work however, because PR c++/67453 means the attribute is ignored on constructors and destructors. As a workaround, the old solution (conditionally inline) is still used for those members, but they are given the always_inline attribute so that they aren't emitted in src/c++11/future.o as inline definitions. libstdc++-v3/ChangeLog: PR libstdc++/97729 * include/std/future (__basic_future::_M_get_result): Use nullptr for null pointer constant. * libsupc++/eh_ptr.cc (operator=3D=3D, operator!=3D): Remove definitions. * libsupc++/exception_ptr.h (_GLIBCXX_EH_PTR_USED): Define macro to conditionally add __attribute__((__used__)). (operator=3D=3D, operator!=3D, exception_ptr::exception_ptr()) (exception_ptr::exception_ptr(const exception_ptr&)) (exception_ptr::~exception_ptr()) (exception_ptr::operator=3D(const exception_ptr&)) (exception_ptr::swap(exception_ptr&)): Always define as inline. Add macro to be conditionally "used".=