================
@@ -535,20 +535,24 @@ void AggExprEmitter::EmitArrayInit(Address DestPtr, 
llvm::ArrayType *AType,
       elementType.isTriviallyCopyableType(CGF.getContext())) {
     CodeGen::CodeGenModule &CGM = CGF.CGM;
     ConstantEmitter Emitter(CGF);
-    LangAS AS = ArrayQTy.getAddressSpace();
+    QualType GVArrayQTy = ArrayQTy;
+    if (!GVArrayQTy.hasAddressSpace())
+      GVArrayQTy = CGM.getContext().getAddrSpaceQualType(
----------------
efriedma-quic wrote:

I think you just just want `GVArrayQTy = 
CGM.getContext().getAddrSpaceQualType(CGM.getContext().removeAddrSpaceQualType(GVArrayQTy),
 CGM.GetGlobalConstantAddressSpace());`, without the "if": you want to change 
the address-space even if the address-space of the destination is explicitly 
specified.

https://github.com/llvm/llvm-project/pull/90048
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to