rjmccall added a comment. In D45898#1324625 <https://reviews.llvm.org/D45898#1324625>, @orivej wrote:
> I have noticed that this change breaks seemingly valid code: > > class A { protected: ~A(); }; > struct B : A {}; > B f() { return B(); } > B g() { return {}; } > > > `f` compiles, but `g` fails with `temporary of type 'A' has protected > destructor`. (g++ 8.2 compiles this file.) We talked about this in the analysis for https://reviews.llvm.org/D53860, and Richard decided that it is indeed invalid under the standard. As a language designer I'm not sure that's a good language rule, but it's the realm of a standard defect, not a compiler bug. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D45898/new/ https://reviews.llvm.org/D45898 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits