]> granicus.if.org Git - clang/commit
[AST/libclang] Fix the selector locations that are reported for a
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 16 Jun 2012 00:46:02 +0000 (00:46 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 16 Jun 2012 00:46:02 +0000 (00:46 +0000)
commita0cff720d40f239fee0e5ecc8378122b456c1991
tree208d410b6a8effba206193579ae69b29d3b636a0
parent843f0e87e5ab9b5b5c36b60e99a350d15679683a
[AST/libclang] Fix the selector locations that are reported for a
method definition that has its '{' attached to the method name without
a space.

With a method like:

-(id)meth{
.....
}

the logic in ObjCMethodDecl that determined the selector locations got
confused because it was initialized based on an end location for '{' but
that end location changed to '}' after the method was finished.

Fix this by having an immutable end location for the declarator and
for getLocEnd() get the end location from the body itself.

Fixes rdar://11659739.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158583 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/DeclObjC.h
lib/AST/DeclObjC.cpp
lib/Sema/SemaDecl.cpp
lib/Serialization/ASTReaderDecl.cpp
test/Index/get-cursor.m
test/Index/overrides.m