[all-commits] [llvm/llvm-project] 2ec79a: [Sema] check InitListExpr format strings like {"foo"}
inclyc via All-commits
all-commits at lists.llvm.org
Tue Nov 22 12:59:52 PST 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 2ec79afd89932f0d5a9c44050e7b6dc08ff51699
https://github.com/llvm/llvm-project/commit/2ec79afd89932f0d5a9c44050e7b6dc08ff51699
Author: Yingchi Long <me at inclyc.cn>
Date: 2022-11-23 (Wed, 23 Nov 2022)
Changed paths:
M clang/lib/Sema/SemaChecking.cpp
M clang/test/SemaCXX/format-strings.cpp
Log Message:
-----------
[Sema] check InitListExpr format strings like {"foo"}
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);
}
Fixes: https://github.com/llvm/llvm-project/issues/58900
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D137839
More information about the All-commits
mailing list