summaryrefslogtreecommitdiffstats
path: root/clang/test
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
commitab468cb14be20d6c308bd9e06e51b6772625ac4b (patch)
tree12ab3ac40ab137a7cfe1c10cd174991be0dc9215 /clang/test
parent779593cd9db4054c7f1cfd3305ac6a8e22014b85 (diff)
downloadbcm5719-llvm-ab468cb14be20d6c308bd9e06e51b6772625ac4b.tar.gz
bcm5719-llvm-ab468cb14be20d6c308bd9e06e51b6772625ac4b.zip
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. llvm-svn: 46984
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Sema/declspec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/test/Sema/declspec.c b/clang/test/Sema/declspec.c
index 05f492d67ac..fd575406812 100644
--- a/clang/test/Sema/declspec.c
+++ b/clang/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 '}'}}
OpenPOWER on IntegriCloud