================ @@ -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(); ---------------- antoniofrighetto wrote:
>From intro.object: > Objects can contain other objects, called subobjects. A subobject can be a > member subobject a base class subobject, or an array element. So, given: ```cpp struct Base { int X; }; struct Derived : Base {}; const Derived Obj; ``` Seems outright logical that the entirety of Obj must be const. Thought this applied only for cv-qualifiers, but should indeed make sense for all qualifiers; updated, thanks! 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