Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / SemaCXX / warn-unsafe-buffer-usage-fixits-parm-main.cpp
blobc6b095031e0e32d75e7de48e4cee1bc4510d5441
1 // RUN: %clang_cc1 -std=c++20 -Wno-all -Wunsafe-buffer-usage -fcxx-exceptions -fsafe-buffer-usage-suggestions -verify %s
2 // RUN: %clang_cc1 -std=c++20 -Wunsafe-buffer-usage -fcxx-exceptions -fdiagnostics-parseable-fixits -fsafe-buffer-usage-suggestions %s 2>&1 | FileCheck %s
4 // We do not fix parameters of the `main` function
6 // CHECK-NOT: fix-it:
8 // main function
9 int main(int argc, char *argv[]) { // expected-warning{{'argv' is an unsafe pointer used for buffer access}}
10 char tmp;
11 tmp = argv[5][5]; // expected-note{{used in buffer access here}} \
12 expected-warning{{unsafe buffer access}}