[PATCH] D137839: [Sema] check InitListExpr format strings like {"foo"}

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 22 12:45:42 PST 2022


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

In D137839#3944574 <https://reviews.llvm.org/D137839#3944574>, @inclyc wrote:

> Do we need release notes here? This patch is just an improvement to https://reviews.llvm.org/D130906

I don't think we need release notes in this case, the existing ones work well enough.

LGTM with a request for an additional test case (you can add it when you land the changes, I don't expect surprises from the test, it's just for regression coverage).



================
Comment at: clang/test/SemaCXX/format-strings.cpp:208
+  constexpr const char *fmt {"%d%d"};
+  printf(fmt, 1, 1); // no-warning
 }
----------------
Cam you also add a test case for:
```
printf(fmt, "oops", 1.0f);
```
to show that we still issue diagnostics when they're appropriate?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137839



More information about the cfe-commits mailing list