[PATCH] D158318: [Sema] tolerate more promotion matches in format string checking
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 21 07:47:22 PDT 2023
aaron.ballman added a comment.
Thank you for this! The changes should come with a release note (in `clang/docs/ReleaseNotes.rst`). Also, you should upload the patch with `-U999` amount of context so that reviewers can see the bigger picture a bit more easily.
================
Comment at: clang/lib/AST/FormatString.cpp:468-474
+ case BuiltinType::Char_U:
+ if (T == C.UnsignedIntTy)
+ return MatchPromotion;
+ if (T == C.UnsignedShortTy)
+ return NoMatchPromotionTypeConfusion;
+ break;
+ case BuiltinType::Char_S:
----------------
`bool` types?
================
Comment at: clang/lib/AST/FormatString.cpp:480-481
+ break;
+ case BuiltinType::Half:
+ case BuiltinType::Float16:
+ case BuiltinType::Float:
----------------
Should these be checking for `T == C.FloatTy` to return `NoMatchPromotionTypeConfusion`?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D158318/new/
https://reviews.llvm.org/D158318
More information about the cfe-commits
mailing list