Fix PR2400 by more graceful handling of invalid decls. Don't try to layout
an invalid struct decl. Thanks to Martin Doucha for the
isIncompleteArrayType part of this patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54592 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/invalid-decl.c b/test/Sema/invalid-decl.c
index 2fa4758..ccd3bc8 100644
--- a/test/Sema/invalid-decl.c
+++ b/test/Sema/invalid-decl.c
@@ -6,3 +6,15 @@
}
+// PR2400
+typedef xtype (*zend_stream_fsizer_t)(void* handle); // expected-error {{function cannot return array or function type}}
+
+typedef struct _zend_module_entry zend_module_entry;
+struct _zend_module_entry {
+ xtype globals_size; // expected-error {{field 'globals_size' declared as a function}}
+};
+
+zend_module_entry openssl_module_entry = {
+ sizeof(zend_module_entry)
+};
+