The following program throws nullptr and then catches the exception as int*:
#include <iostream>
int main() {
try {
throw nullptr;
}
catch(int*) {
std::cout << "caught int*";
}
catch(...) {
std::cout << "caught other";
}
}
In Clang and GCC the program successfully prints caught int*, demo: https://gcc.godbolt.org/z/789639qbb
However in Visual Studio 16.11.2 the program prints caught other. Is it a bug in MSVC?