diff options
author | Congcong Cai <congcongcai0907@163.com> | 2024-09-19 22:46:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-19 22:46:16 +0800 |
commit | 5fa742eeed0821baf864d23f237ff1b481e1ae11 (patch) | |
tree | 12d3cee3139e30d764234b739e71bb97fde76816 /clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp | |
parent | c4744e49f60ea3bce5a38d4917bcde8eb8abb7e1 (diff) | |
download | llvm-5fa742eeed0821baf864d23f237ff1b481e1ae11.zip llvm-5fa742eeed0821baf864d23f237ff1b481e1ae11.tar.gz llvm-5fa742eeed0821baf864d23f237ff1b481e1ae11.tar.bz2 |
[clang-tidy][NFC] add qutation mark for C++ classes in warning message (#109068)
As discussion in
https://github.com/llvm/llvm-project/pull/108555#discussion_r1761841192,
split quotation mark change in a new NFC PR.
It is more readable to use `'std::array'` than `std::array<>`
Diffstat (limited to 'clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp b/clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp index 9877819..0804aa7 100644 --- a/clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp @@ -80,18 +80,18 @@ void AvoidCArraysCheck::check(const MatchFinder::MatchResult &Result) { enum class RecommendType { Array, Vector, Span }; llvm::SmallVector<const char *> RecommendTypes{}; if (IsVLA) { - RecommendTypes.push_back("std::vector<>"); + RecommendTypes.push_back("'std::vector'"); } else if (ArrayType->getTypePtr()->isIncompleteArrayType() && IsInParam) { // in function parameter, we also don't know the size of // IncompleteArrayType. if (Result.Context->getLangOpts().CPlusPlus20) - RecommendTypes.push_back("std::span<>"); + RecommendTypes.push_back("'std::span'"); else { - RecommendTypes.push_back("std::array<>"); - RecommendTypes.push_back("std::vector<>"); + RecommendTypes.push_back("'std::array'"); + RecommendTypes.push_back("'std::vector'"); } } else { - RecommendTypes.push_back("std::array<>"); + RecommendTypes.push_back("'std::array'"); } diag(ArrayType->getBeginLoc(), "do not declare %select{C-style|C VLA}0 arrays, use %1 instead") |