<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Aug 4, 2014 at 8:49 AM, Kevin Funk <span dir="ltr"><<a href="mailto:kfunk@kde.org" target="_blank">kfunk@kde.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey,<br>
<br>
Context: We're using libclang as our C++ parser backend in KDevelop.<br>
<br>
We're having some difficulties in finding the correct range for some<br>
identifiers using libclang. Example:<br>
<br>
% cat test.cpp<br>
struct Foo<br>
{<br>
    void operator++() {}<br>
};<br>
<br>
% c-index-test -cursor-at=test.cpp:3:10 test.cpp<br>
3:10 CXXMethod=operator++:3:10 (Definition) Extent=[3:5 - 3:25]<br>
Spelling=operator++ ([3:10 - 3:18])<br>
Completion string: {ResultType void}{TypedText operator++}{LeftParen (}<br>
{RightParen )}<br>
<br>
Here, the range is obviously wrong: [3:10 - 3:18] only points to 'operator',<br>
not 'operator++'. This is the fault of clang_Cursor_getSpellingNameRange.<br>
This happens for a C++ destructor declaration (only '~' is in the range), and<br>
all operator overloads (only 'operator' in the range).<br>
<br>
I guess that this is a bug, and not intended, and that<br>
clang_Cursor_getSpellingNameRange just needs special-casing for C.kind ==<br>
CXCursor_CXXMethod and friends. Am I right in that assumption and a patch<br>
would be accepted?</blockquote><div><br></div><div>Yes =)</div><div><br></div><div>(Sorry if this has already been answered in another thread, I'm going through my backlog of seemingly-unanswered mail.)</div></div></div></div>