================ @@ -3107,8 +3107,11 @@ Sema::PerformObjectMemberConversion(Expr *From, /*IgnoreAccess=*/true)) return ExprError(); - return ImpCastExprToType(From, DestType, CK_UncheckedDerivedToBase, - VK, &BasePath); + if (FromType.isVolatileQualified()) + DestType.addVolatile(); ---------------- AaronBallman wrote:
Should we be doing this for all qualifiers? `const` seems like it should almost certainly behave the same way, but I think it's a more general property of qualifiers that the derived to base cast would keep the qualifiers. https://github.com/llvm/llvm-project/pull/127824 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits