================
@@ -2199,12 +2200,12 @@ ExprResult Sema::BuildCXXNew(SourceRange Range, bool 
UseGlobal,
   auto *Deduced = AllocType->getContainedDeducedType();
   if (Deduced && !Deduced->isDeduced() &&
       isa<DeducedTemplateSpecializationType>(Deduced)) {
-    if (ArraySize)
-      return ExprError(
-          Diag(*ArraySize ? (*ArraySize)->getExprLoc() : TypeRange.getBegin(),
-               diag::err_deduced_class_template_compound_type)
-          << /*array*/ 2
-          << (*ArraySize ? (*ArraySize)->getSourceRange() : TypeRange));
+    if (ArraySize) {
+      return ExprError(Diag(ArraySize.getExprLocOr(TypeRange.getBegin()),
+                            diag::err_deduced_class_template_compound_type)
+                       << /*array*/ 2
+                       << ArraySize.getExprSourceRangeOr(TypeRange));
+    }
----------------
ojhunt wrote:

e.g this change is only needed for the API change

https://github.com/llvm/llvm-project/pull/186617
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to