Adds InitListExpr case in format string checks.
e.g.
int sprintf(char *__restrict, const char * __restrict, ...); int foo() { char data[100]; constexpr const char* fmt2{"%d"}; // no-warning sprintf(data, fmt2, 123); }
Differential D137839
[Sema] check InitListExpr format strings like {"foo"} inclyc on Nov 11 2022, 6:50 AM. Authored by
Details Adds InitListExpr case in format string checks. e.g. int sprintf(char *__restrict, const char * __restrict, ...); int foo() { char data[100]; constexpr const char* fmt2{"%d"}; // no-warning sprintf(data, fmt2, 123); }
Diff Detail
Event TimelineComment Actions Do we need release notes here? This patch is just an improvement to https://reviews.llvm.org/D130906 Comment Actions 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).
|
Cam you also add a test case for:
to show that we still issue diagnostics when they're appropriate?