当前位置:网站首页>What happens when you use "-fno exceptions", "new T"- With “-fno-exceptions”, what happens with “new T”?

What happens when you use "-fno exceptions", "new T"- With “-fno-exceptions”, what happens with “new T”?

2022-06-25 05:20:00 fyin1314

problem :

I was wondering, will new T still throw bad_alloc if I compile my program using the -fno-exceptions option to disable exception handling? I want to know , If I use -fno-exceptions Option to compile my program to disable exception handling , new T And throw bad_alloc Do you ?

Or will the compiler (GCC and clang support that option) implicitly transform the use of new T to new (nothrow) T ? Or the compiler (GCC and clang Whether this option is supported ) Will you new T The use of is implicitly converted to new (nothrow) T


Solution :

Reference resources : https://stackoom.com/en/question/PNlb
原网站

版权声明
本文为[fyin1314]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202210517178570.html