Skip to content

Commit

Permalink
[-Wunsafe-buffer-usage][NFC] Reintroduce lost test cases (#82060)
Browse files Browse the repository at this point in the history
We likely accidentally removed these as part of conflict resolution.
  • Loading branch information
jkorous-apple committed Feb 16, 2024
1 parent 0e6a48c commit 979c4e9
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,36 @@ void local_variable_qualifiers_specifiers() {
int tmp;
tmp = p[5];
tmp = q[5];

[[deprecated]] const int * x = a;
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:18-[[@LINE-1]]:29}:"std::span<int const>"
const int * y [[deprecated]];
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:3-[[@LINE-1]]:14}:"std::span<int const>"
tmp = x[5];
tmp = y[5];
}

void local_variable_unsupported_specifiers() {
int a[10];
const int * p [[deprecated]] = a; // not supported because the attribute overlaps the source range of the declaration
// CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-1]]:

static const int * q = a; // storage specifier not supported yet
// CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-1]]:

extern int * x; // storage specifier not supported yet
// CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-1]]:

constexpr int * y = 0; // `constexpr` specifier not supported yet
// CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-1]]:

int tmp;

tmp = p[5];
tmp = q[5];
tmp = x[5];
tmp = y[5];
}

void local_array_subscript_variable_extent() {
int n = 10;
Expand Down

0 comments on commit 979c4e9

Please sign in to comment.