diff options
author | Chris Lattner <sabre@nondot.org> | 2007-07-19 00:42:40 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-07-19 00:42:40 +0000 |
commit | 5265af5b555f703be365dbc32c4e518fe38d4d9a (patch) | |
tree | f643d0be2e2ba37f10b9b95e3f162c6e198db826 /test/Sema/array-constraint.c | |
parent | 938867c6cf8926fb5ff559095c452b8e15ab5d2a (diff) |
Fix a crasher that Neil reported: Sema::GetTypeForDeclarator should never
return a null type. If there is an error parsing the type, pick a new type
for error recovery purposes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40029 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/array-constraint.c')
-rw-r--r-- | test/Sema/array-constraint.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Sema/array-constraint.c b/test/Sema/array-constraint.c new file mode 100644 index 0000000000..4b70bb9bb3 --- /dev/null +++ b/test/Sema/array-constraint.c @@ -0,0 +1,11 @@ +// RUN: clang -parse-ast-check %s + +struct s; +struct s* t (struct s z[]) { // expected-error {{array has incomplete element type}} + return z; +} + +void *k (void l[2]) { // expected-error {{array has incomplete element type}} + return l; +} + |