1 // This program should FAIL to build iff exceptions and RTTI are disabled. 2 #ifdef __EXCEPTIONS 3 // can't fail to build here 4 int main(void) { return 0; } 5 #else // !exceptions 6 #include <typeinfo> 7 #include <stdio.h> 8 9 class Foo { int x; }; 10 11 int main(void) { 12 printf("%p\n", typeid(Foo)); // will fail with RTTI 13 return 0; 14 } 15 #endif 16