mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-03 16:16:05 +00:00

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
12 lines
520 B
Plaintext
12 lines
520 B
Plaintext
// 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 '}'}}
|