[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaCXX / warn-unsafe-buffer-usage-suggestions-crashes.cpp
blobbf4faec184ee17ac470fbf96f8ece26d5d527fb0
1 // RUN: %clang_cc1 -std=c++20 -Wunsafe-buffer-usage \
2 // RUN: -fsafe-buffer-usage-suggestions \
3 // RUN: %s -verify %s
5 char * unsafe_pointer; // expected-warning{{'unsafe_pointer' is an unsafe pointer used for buffer access}}
7 void test(char * param) {
10 void dre_parenthesized() {
11 test(&(unsafe_pointer)[1]); // no-crash // expected-note{{used in buffer access here}}