From c9d6b42449f23729acc37ad183e65d6146755a24 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Wed, 11 Jun 2014 16:54:09 +0000 Subject: Add a FAQ section, with a question about why the std::exception class destructors live in libc++abi git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@210661 91177308-0d34-0410-b5e6-96231b3b80d8 --- www/index.html | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'www/index.html') diff --git a/www/index.html b/www/index.html index 5d4e247..a174afd 100644 --- a/www/index.html +++ b/www/index.html @@ -82,6 +82,22 @@

Send discussions to the (clang mailing list).

+ +

Frequently asked questions

+ + +

Q: Why are the destructors for the standard exception classes defined in libc++abi? + They're just empty, can't they be defined inline?

+

A: The destructors for them live in libc++abi because they are "key" functions. + The Itanium ABI describes a "key" function as the first virtual declared. + And wherever the key function is defined, that is where the type_info gets defined. + And in libc++ types are the same type if and only if they have the same type_info + (as in there must be only one type info per type in the entire application). + And on OS X, libstdc++ and libc++ share these exception types. + So to be able to throw in one dylib and catch in another (a std::exception for example), + there must be only one std::exception type_info in the entire app. + That typeinfo gets laid down beside ~exception() in libc++abi (for both libstdc++ and libc++).

+

--Howard Hinnant

-- cgit v1.2.3