Consider this short snippet:
struct B {
B() = default;
explicit B(B const& ) { }
};
struct D : B { };
int main() {
try {
throw D{};
}
catch(B ) {
}
}
gcc accepts this code, clang considers it ill-formed with:
main.cpp:17:13: error: no matching constructor for initialization of 'B'
catch(B ) {
^
Who's right?