0

I wanted to use try catch statement in clang libtooling,but by default it is taking compiling options as -fno-rtti and -fno-exceptions

If I use the try-catch statement in clang libtooling , It is throwing error message

samplecode

try
{



}
catch(std::exception &e)
{


} 

Cannot Use try with Exception Disabled.

How to enable try catch for clang libtooling program?

Jon marsh
  • 279
  • 7
  • 12
  • 1
    A call within the scope of a try statement can potentially raise an exception. In those circumstances, the LLVM C++ front-end replaces the call with an invoke instruction. Unlike a call, the invoke has two potential continuation points. https://llvm.org/docs/ExceptionHandling.html#try-catch ` __cxa_throw.` – ABC Dec 09 '19 at 05:39
  • 1
    I found the answer in this post https://stackoverflow.com/questions/21411798/enabling-rtti-for-clang-tool – Jon marsh Dec 10 '19 at 07:21

0 Answers0