================
@@ -9739,6 +9761,20 @@ bool Sema::RequireCompleteTypeImpl(SourceLocation Loc, 
QualType T,
                               /*Recover*/ TreatAsComplete);
       return !TreatAsComplete;
     }
+
+    // The element type may have been incomplete when the array type was
+    // formed, in which case BuildArrayType could not check the array's size.
+    if (T->isConstantArrayType() && !T->isDependentType() &&
+        !T->isVariablyModifiedType() && !T->isUndeducedType()) {
+      if (const ConstantArrayType *CAT = findArrayTypeTooLarge(Context, T)) {
+        if (Diagnoser)
+          Diag(Loc, diag::err_array_too_large)
+              << toString(CAT->getSize(), 10, /*Signed=*/false,
----------------
erichkeane wrote:

APInt already has a operator<<, why are you doing the `toString` stuff here? 

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

Reply via email to