From owner-freebsd-standards@FreeBSD.ORG Sat Jan 26 17:10:01 2013 Return-Path: Delivered-To: freebsd-standards@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BDF8526A for ; Sat, 26 Jan 2013 17:10:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id ABEF8836 for ; Sat, 26 Jan 2013 17:10:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r0QHA1Ub003898 for ; Sat, 26 Jan 2013 17:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.6/8.14.6/Submit) id r0QHA11J003897; Sat, 26 Jan 2013 17:10:01 GMT (envelope-from gnats) Date: Sat, 26 Jan 2013 17:10:01 GMT Message-Id: <201301261710.r0QHA11J003897@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org Cc: From: Eitan Adler Subject: Re: standards/175453: Catching C std::bad_cast doesn't work in FreeBSD 9.1 X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Eitan Adler List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2013 17:10:01 -0000 The following reply was made to PR standards/175453; it has been noted by GNATS. From: Eitan Adler To: bug-followup@freebsd.org, hongli@phusion.nl Cc: Subject: Re: standards/175453: Catching C std::bad_cast doesn't work in FreeBSD 9.1 Date: Sat, 26 Jan 2013 12:07:14 -0500 This bug is probably well understood by now, but here is a minimal testcase for it (no includes, as few C++ features as possible): extern "C++" { namespace std { class exception { const char* name() const { } }; class bad_cast : public exception { }; } } class foo { public: virtual ~foo() { } }; class bar: public foo { public: int val; bar(): val(123) { } }; static void cast_test(const foo &f) { try { const bar &b = dynamic_cast(f); } catch (const std::bad_cast &) { } } int main() { foo f; cast_test(f); } -- Eitan Adler