Must `throw nullptr` be caught as a pointer, regardless of pointer type?

Looks like a bug in Visual Studio, according to the standard [except.handle]:

A handler is a match for an exception object of type E if

[…]

  • the handler is of type cv T or const T& where T is a pointer or pointer-to->member type and E is std​::​nullptr_t.

Leave a Comment