aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/declspec.c
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-02-12 04:08:59 +0000
committerSteve Naroff <snaroff@apple.com>2008-02-12 04:08:59 +0000
commit9532414c45a7114d9e94a733121655a5b5d5b473 (patch)
treed4ba3deb76aa857fa7f84f9f7b056e532d181a3f /test/Sema/declspec.c
parentfabbc34f75960574514225de737f9985ae577112 (diff)
Allow the parser to detect invalid DeclSpec's. This fixes http://llvm.org/bugs/show_bug.cgi?id=1987.
This commit only "guards" the call to ParseDeclarationSpecifiers() in ParseDeclarationOrFunctionDefinition(). We could consider guarding all calls, however this is a bit radical (since it effectively stops parsing the declaration once we have a bad declspec). Will discuss with Chris tomorrow. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46984 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/declspec.c')
-rw-r--r--test/Sema/declspec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/Sema/declspec.c b/test/Sema/declspec.c
index 05f492d67a..fd57540681 100644
--- a/test/Sema/declspec.c
+++ b/test/Sema/declspec.c
@@ -5,4 +5,8 @@ T foo(int n, int m) { } // expected-error {{cannot return array or function}}
void foof(const char *, ...) __attribute__((__format__(__printf__, 1, 2))), barf (void);
-
+struct _zend_module_entry { }
+typedef struct _zend_function_entry { } // expected-error {{cannot combine with previous 'struct' declaration specifier}}
+static void buggy(int *x) { // expected-error {{cannot combine with previous 'typedef' declaration specifier}} \
+ // expected-error {{cannot combine with previous 'struct' declaration specifier}}
+ // expected-error {{expected '}'}}