[clang] [clang][Sema] Avoid assert when diagnosing address-space qualified new/delete (PR #178424)
Ayush Kumar Gaur via cfe-commits
cfe-commits at lists.llvm.org
Sun Feb 8 07:30:55 PST 2026
================
@@ -2676,8 +2695,9 @@ bool Sema::CheckAllocatedType(QualType AllocType, SourceLocation Loc,
else if (AllocType.getAddressSpace() != LangAS::Default &&
!getLangOpts().OpenCLCPlusPlus)
return Diag(Loc, diag::err_address_space_qualified_new)
- << AllocType.getUnqualifiedType()
- << AllocType.getQualifiers().getAddressSpaceAttributePrintValue();
+ << AllocType.getUnqualifiedType()
+ << formatAddressSpaceForDiag(AllocType, getLangOpts(), Context);
----------------
Ayush3941 wrote:
Okay 👍 reverted it back to only printing address space is it good to merge
https://github.com/llvm/llvm-project/pull/178424
More information about the cfe-commits
mailing list