Don"t work Clang Static Analyzer

Hello.
Today there was a case when analyzing the software (test.cpp) by Clang Staic Analyzer (CSA).
The following code contains the BUG, that involves using an uninitialized variable.

test.cpp:

include
using namespace std;
int main(){
int i,k[1];
char str[5]={‘a’,‘b’,‘c’,‘d’,‘e’};
for (i=0;i<4;i++)
{
if (i==5) k[0]=3;
}
cout<<“k[0]=”<<k[0]<<"\n";
cout<<str[k[0]]<<"\n";
return 0;
}

Analysis using CSA (by “scan-build g++ test.cpp -o test.out”) does not detect the BUG.
If the number of loop iterations is reduced to 3, the BUG is detected.

What is the problem?
How to fix it?