Skip to content
Unverified Commit 2ec79afd authored by Yingchi Long's avatar Yingchi Long
Browse files

[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
parent d9ef5574
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment