]> granicus.if.org Git - clang/commit
Fix the end location of init-capture annotations in ObjC++
authorBen Langmuir <blangmuir@apple.com>
Thu, 30 Apr 2015 18:40:23 +0000 (18:40 +0000)
committerBen Langmuir <blangmuir@apple.com>
Thu, 30 Apr 2015 18:40:23 +0000 (18:40 +0000)
commitb13f5adf4637a3d03f4c084ff8ec53da8515e3b8
tree4d975ee1847363db5e44f045594c982a786793e8
parentcf9716e5dc5c23669f6db78ab473ef3545de4ae2
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236246 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Lex/Preprocessor.h
test/Parser/objcxx0x-lambda-expressions.mm