diff options
| author | John McCall <rjmccall@apple.com> | 2010-09-07 18:31:03 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2010-09-07 18:31:03 +0000 |
| commit | 1ca73da0e65b6ebf061491927baa1d380bfc3b99 (patch) | |
| tree | 8a439d3801ba7b06526f8447af56e241000b959d /clang/test/Parser | |
| parent | 4f5d4b4a6e21c6cbec4c8a5e9dfe041199979ec4 (diff) | |
| download | bcm5719-llvm-1ca73da0e65b6ebf061491927baa1d380bfc3b99.tar.gz bcm5719-llvm-1ca73da0e65b6ebf061491927baa1d380bfc3b99.zip | |
Improve error recovery when we see ':' and expect a ';'.
I, at least, make this typo all the time.
llvm-svn: 113243
Diffstat (limited to 'clang/test/Parser')
| -rw-r--r-- | clang/test/Parser/objc-interfaces.m | 2 | ||||
| -rw-r--r-- | clang/test/Parser/recovery.c | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/clang/test/Parser/objc-interfaces.m b/clang/test/Parser/objc-interfaces.m index aac3faa4350..0ae17f15ee4 100644 --- a/clang/test/Parser/objc-interfaces.m +++ b/clang/test/Parser/objc-interfaces.m @@ -3,6 +3,6 @@ // Test features and error recovery for objc interfaces. @interface INTF -- (int*) foo2 __attribute__((deprecated)) : (int) x1 __attribute__((deprecated)); // expected-error {{expected ';' after method prototype}} +- (int*) foo2 __attribute__((deprecated)) : (int) x1 __attribute__((deprecated)); // expected-error {{expected ';' after method prototype}} expected-error {{method type specifier must start with '-' or '+'}} @end diff --git a/clang/test/Parser/recovery.c b/clang/test/Parser/recovery.c index 6cd95da878d..1b33f0225bc 100644 --- a/clang/test/Parser/recovery.c +++ b/clang/test/Parser/recovery.c @@ -78,3 +78,9 @@ void foo() { // rdar://7980651 typedef int intptr_t; // expected-note {{'intptr_t' declared here}} void bar(intptr y); // expected-error {{unknown type name 'intptr'; did you mean 'intptr_t'?}} + +void test1(void) { + int x = 2: // expected-error {{expected ';' at end of declaration}} + int y = x; + int z = y; +} |

