[PATCH] D158318: [Sema] tolerate more promotion matches in format string checking

FĂ©lix Cloutier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 22 19:53:49 PDT 2023


fcloutier added inline comments.


================
Comment at: clang/lib/AST/FormatString.cpp:480-481
+              break;
+            case BuiltinType::Half:
+            case BuiltinType::Float16:
+            case BuiltinType::Float:
----------------
aaron.ballman wrote:
> Should these be checking for `T == C.FloatTy` to return `NoMatchPromotionTypeConfusion`?
I don't think it's necessary. `T` is the format specifier's expected type, and no format specifier expects a `float` (due to floating-point types being promoted to `double` by default argument promotion), so there's never a case where `T` is `FloatTy`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158318/new/

https://reviews.llvm.org/D158318



More information about the cfe-commits mailing list