brintos

brintos / llvm-project-archived public Read only

0
0
Text · 629 B · c6b0950 Raw
14 lines · cpp
1// RUN: %clang_cc1 -std=c++20 -Wno-all -Wunsafe-buffer-usage -fcxx-exceptions  -fsafe-buffer-usage-suggestions -verify %s2// RUN: %clang_cc1 -std=c++20 -Wunsafe-buffer-usage -fcxx-exceptions -fdiagnostics-parseable-fixits  -fsafe-buffer-usage-suggestions %s 2>&1 | FileCheck %s3 4// We do not fix parameters of the `main` function5 6// CHECK-NOT: fix-it:7 8// main function9int 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}}13}14