Is there a relation between RTTI and exceptions?

They are not dependent on each other but they are both heavy features so if there is a platform that has bad performance they will probably both be cut together.


No, Exceptions do not need RTTI functionality neither vice versa both are separate features.

Some of the implementations might allow you to disable exceptions(-fnoexceptions in gcc) but I don't know of any implementation which needs RTTI for exceptions or vice versa.


I was just reading this C++ proposal "Zero-overhead deterministic exceptions: Throwing values" (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0709r0.pdf?), in which I read:

"C++ allows there to be multiple active exception objects of arbitrary types, which must have unique addresses and cannot be folded; and it requires using RTTI to match handlers at run time, which has statically unpredictable cost on all major implementations and can depend on what else is linked into the whole program."

and elsewhere it is stated that:

"4) Today’s dynamic exceptions require using some form of RTTI to match handlers."

Thus, it appears there is a relation between exceptions and RTTI