mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 08:26:07 +00:00

- Prevent nullptr-deference at try to emit warning for invalid `expr` - Simplify `InitListChecker::UpdateStructuredListElement()` usages. We do not need to check `expr` and increment `StructuredIndex` (for invalid `expr`) before the call anymore. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D85193
9 lines
194 B
C
9 lines
194 B
C
// RUN: %clang_cc1 %s -verify -fsyntax-only
|
|
|
|
struct S {
|
|
Unknown u; // expected-error {{unknown type name 'Unknown'}}
|
|
int i;
|
|
};
|
|
// Should not crash
|
|
struct S s[] = {[0].i = 0, [1].i = 1, {}};
|