C++: Call noexcept constructor instead.

This commit is contained in:
Mathias Vorreiter Pedersen
2021-05-06 14:30:43 +02:00
parent 6cdef782c8
commit 42b8f923be

View File

@@ -202,7 +202,7 @@ void bad_new_with_nonthrowing_call() {
try {
int* p2 = new(std::nothrow) int; // GOOD: boolean conversion constructor might throw
Foo f(12);
Foo f;
if(f) { }
} catch(...) { }
}