================ @@ -2495,10 +2470,113 @@ static FixItList fixVariableWithSpan(const VarDecl *VD, return fixLocalVarDeclWithSpan(VD, Ctx, getUserFillPlaceHolder(), Handler); } +static FixItList fixVarDeclWithArray(const VarDecl *D, const ASTContext &Ctx, + UnsafeBufferUsageHandler &Handler) { + FixItList FixIts{}; + + if (auto CAT = dyn_cast<clang::ConstantArrayType>(D->getType())) { + const QualType &ArrayEltT = CAT->getElementType(); + assert(!ArrayEltT.isNull() && "Trying to fix a non-array type variable!"); + + // For most types the transformation is simple: + // T foo[10]; => std::array<T, 10> foo; + // Cv-specifiers are straigtforward: + // const T foo[10]; => std::array<const T, 10> foo; + // Pointers are straightforward: + // T * foo[10]; => std::array<T *, 10> foo; + // + // However, for const pointers the transformation is different: + // T * const foo[10]; => const std::array<T *, 10> foo; ---------------- jkorous-apple wrote:
You're right, let me simplify this. https://github.com/llvm/llvm-project/pull/80084 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits