================ @@ -96,6 +97,26 @@ void AvoidCArraysCheck::check(const MatchFinder::MatchResult &Result) { diag(ArrayType->getBeginLoc(), "do not declare %select{C-style|C VLA}0 arrays, use %1 instead") << IsVLA << llvm::join(RecommendTypes, " or "); + + if (CheckSugaredTypes) { + PrintingPolicy PrintPolicy{getLangOpts()}; + PrintPolicy.SuppressTagKeyword = true; + + const auto TypeName = ArrayType->getType().getAsString(PrintPolicy); + const auto DesugaredTypeName = ArrayType->getType() + ->getUnqualifiedDesugaredType() + ->getCanonicalTypeInternal() + .getAsString(PrintPolicy); + if (TypeName != DesugaredTypeName) { ---------------- PiotrZSL wrote:
avoid using string comparison, compare types https://github.com/llvm/llvm-project/pull/131468 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits