From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5448 invoked by alias); 11 Mar 2012 11:21:11 -0000 Received: (qmail 5435 invoked by uid 22791); 11 Mar 2012 11:21:10 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 11 Mar 2012 11:20:58 +0000 From: "paolo.carlini at oracle dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/52540] std::use_facet throws bad_cast when compiled with _GLIBCXX_DEBUG Date: Sun, 11 Mar 2012 11:21:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: paolo.carlini at oracle dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-03/txt/msg00802.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52540 --- Comment #9 from Paolo Carlini 2012-03-11 11:20:40 UTC --- Then this is a very old issue, isn't it? Why nobody noticed it before? To be clear, in debug-mode we don't use extern templates only for basic_string (because _GLIBCXX_EXTERN_TEMPLATE becomes -1 when _GLIBCXX_DEBUG is defined), all the other facilities remain the same still use extern tamplate. This is in order to enable debug-mode checks also at -O0 for basic_string. Now, I don't see why a few less extern template can make a difference on mingw in terms of correctness of use_facet or anything else, but if that's really the case due to fundamental limitations somehwhere, we can trade it for the -O0 basic_string checks on the affected systems, I have no problems with that (note that, AFAICS, the problem will not go away with a new C++11 conforming string class, unless we decide to not export from the .so parts of basic_string)