================ @@ -404,7 +404,7 @@ AST_MATCHER(CXXConstructExpr, isSafeSpanTwoParamConstruct) { if (Arg0Ty->isConstantArrayType()) { const APSInt ConstArrSize = - APSInt(cast<ConstantArrayType>(Arg0Ty)->getSize()); + APSInt(cast<ConstantArrayType>(Arg0Ty.getCanonicalType())->getSize()); ---------------- haoNoQ wrote:
There's this whole `ASTContext::getAsArrayType()` thing (et al.): > This is a member of > [ASTContext](https://clang.llvm.org/doxygen/classclang_1_1ASTContext.html) > because this may need to do some amount of canonicalization, e.g. to move > type qualifiers into the element type. I.e. such "canonicalization" is stronger than a simple `.getCanonicalType()` and it sounds like we're supposed to do that consistently. So we probably should use `ASTContext::getAsConstantArrayType()` in such cases. https://github.com/llvm/llvm-project/pull/102953 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits