mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 06:06:06 +00:00

Bound check on array of zero-sized element isn't meaningful. Fixes https://github.com/llvm/llvm-project/issues/64564 Reviewed By: jacquesguan Differential Revision: https://reviews.llvm.org/D157584
13 lines
359 B
C
13 lines
359 B
C
// RUN: %clang_cc1 -triple i686-apple-darwin -verify %s
|
|
|
|
int a[][0]; // expected-warning {{tentative array definition assumed to have one element}}
|
|
void gh64564_1(void) {
|
|
int b = a[0x100000000][0];
|
|
}
|
|
|
|
typedef struct {} S;
|
|
S s[]; // expected-warning {{tentative array definition assumed to have one element}}
|
|
void gh64564_2(void) {
|
|
S t = s[0x100000000];
|
|
}
|