[cfe-dev] cannot use 'throw' with exceptions disabled

John McCall rjmccall at apple.com
Thu May 19 13:35:16 PDT 2011


On May 19, 2011, at 1:27 PM, Hao Jiang wrote:
> Hello everyone,
> I tried to make a clang plugin to parse the source code. But when I parse
> the file clang generate errors as following:
> /opt/local/bin/mpicxx -E -C -I. -I../.. -g -O2 -o _tmp_0.cc chevt.cc
> /Users/llvm/Release+Asserts/bin/clang -cc1 -load
> ../../xlate/clangit/libannotate.so -plugin minissf-annotate -I. -I../.. -g
> -O2 -fexceptions _tmp_0.cc -o _tmp_1.x

Are you writing your own driver or something?  If so, you need to pass -fcxx-exceptions to -cc1 to enable C++-specific exceptions behavior.

John.



More information about the cfe-dev mailing list