How to get CLion to show exceptions?

[亡魂溺海] 提交于 2020-06-17 02:06:26

问题


I have CLion installed with presumably default configuration. I think something is wrong with it, because I can't see exceptions. For example, this code:

int main(){ throw 5; }

Prints only Process finished with exit code 0

  • Why doesn't it print the exception?
  • Why does it print 0 instead of 1?

For comparison:

int main(){try { throw 5; } catch(int x) { std::cout << x << '\n'; }}

This prints 5, so it looks like code is correctly run and the exception is correctly thrown. It's just hidden by CLion somehow.

Edit: This is not a duplicate of "not seeing any console output". I made extremely clear in my question that I was indeed seeing console output for prints. My issue concerns exceptions specifically, not console output generally.

来源:https://stackoverflow.com/questions/52623592/how-to-get-clion-to-show-exceptions

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!