summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/objcxx11-messaging-and-lambda.mm
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2016-05-31 18:46:31 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2016-05-31 18:46:31 +0000
commit29b342351f3c9ee9f3ba86946984ac56a8ebeffc (patch)
tree302cf6ea5469676b0f46ddc91142877897128bf2 /clang/test/Parser/objcxx11-messaging-and-lambda.mm
parentfbdbe9e22ba3a383fff73546ff59b94f8a46f595 (diff)
downloadbcm5719-llvm-29b342351f3c9ee9f3ba86946984ac56a8ebeffc.tar.gz
bcm5719-llvm-29b342351f3c9ee9f3ba86946984ac56a8ebeffc.zip
[Parser] Fix look ahead after EOF while parsing objc message and lambdas
If a closing ')' isn't found for a macro instantiation inside a '[', the next token is EOF, this leads to crashes if we try to look ahead of that. This could be triggered whenever trying to parse lambdas or objs message expressions. Differential Revision: http://reviews.llvm.org/D20451 rdar://problem/25662647 llvm-svn: 271314
Diffstat (limited to 'clang/test/Parser/objcxx11-messaging-and-lambda.mm')
-rw-r--r--clang/test/Parser/objcxx11-messaging-and-lambda.mm11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/Parser/objcxx11-messaging-and-lambda.mm b/clang/test/Parser/objcxx11-messaging-and-lambda.mm
new file mode 100644
index 00000000000..002f3e9c710
--- /dev/null
+++ b/clang/test/Parser/objcxx11-messaging-and-lambda.mm
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+
+#define OBJCLASS(name) // expected-note {{macro 'OBJCLASS' defined here}}
+
+class NSMutableData;
+
+NSMutableData *test() { // expected-note {{to match this '{'}}
+ NSMutableData *data = [[[OBJCLASS(NSMutableDataOBJCLASS( alloc] init] autorelease]; // expected-error {{unterminated function-like macro invocation}} \
+ // expected-error {{expected ';' at end of declaration}}
+ return data;
+} // expected-error {{expected expression}} expected-error {{expected '}'}}
OpenPOWER on IntegriCloud