From a80cae11f6cdbc92b0a5c47c454534ac564452d3 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Fri, 17 Feb 2012 03:49:44 +0000 Subject: Disambiguate between C++11 lambda expressions and C99 array designators in the parser. In the worst case, this disambiguation requires tentative parsing just past the closing ']', but for most cases we'll be able to tell by looking ahead just one token (without going into the heavyweight tentative parsing machinery). llvm-svn: 150790 --- clang/test/Parser/cxx0x-lambda-expressions.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'clang/test/Parser/cxx0x-lambda-expressions.cpp') diff --git a/clang/test/Parser/cxx0x-lambda-expressions.cpp b/clang/test/Parser/cxx0x-lambda-expressions.cpp index a25116b460a..87d14051e92 100644 --- a/clang/test/Parser/cxx0x-lambda-expressions.cpp +++ b/clang/test/Parser/cxx0x-lambda-expressions.cpp @@ -25,5 +25,16 @@ class C { return 1; } + void designator_or_lambda() { + typedef int T; + const int b = 0; + const int c = 1; + int a1[1] = {[b] (T()) {}}; // expected-error{{no viable conversion from 'C::