summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorBen Langmuir <blangmuir@apple.com>2015-04-30 18:40:23 +0000
committerBen Langmuir <blangmuir@apple.com>2015-04-30 18:40:23 +0000
commitc861f4174dcf5132a149f83193cfbfd851f18bab (patch)
tree477aab9ee38479738881d359dbd1f802449543bd /clang/test
parent03b99f66d7189be049ba269bbe9afcb42e34a371 (diff)
downloadbcm5719-llvm-c861f4174dcf5132a149f83193cfbfd851f18bab.tar.gz
bcm5719-llvm-c861f4174dcf5132a149f83193cfbfd851f18bab.zip
Fix the end location of init-capture annotations in ObjC++
And thereby stop asserting. In ObjC++ modes, we tentatively parse the lambda introducer twice: once to disambiguate designators, which we also do in C++, and a second time to disambiguate objc message expressions. During the second tentative parse, the last cached token will be the annotation token we built in the first parse. So use getLastLoc() to get the correct end location for the rebuilt annotation. llvm-svn: 236246
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Parser/objcxx0x-lambda-expressions.mm13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/Parser/objcxx0x-lambda-expressions.mm b/clang/test/Parser/objcxx0x-lambda-expressions.mm
index 3954a807a5f..c6ed121f8b4 100644
--- a/clang/test/Parser/objcxx0x-lambda-expressions.mm
+++ b/clang/test/Parser/objcxx0x-lambda-expressions.mm
@@ -41,3 +41,16 @@ class C {
};
+struct Func {
+ template <typename F>
+ Func(F&&);
+};
+
+int getInt();
+
+void test() {
+ [val = getInt()]() { };
+ Func{
+ [val = getInt()]() { }
+ };
+}
OpenPOWER on IntegriCloud