This is an archive of the discontinued LLVM Phabricator instance.

Fix for clang_Cursor_getSpellingNameRange()
ClosedPublic

Authored by kfunk on Mar 24 2016, 3:07 PM.

Details

Summary

Fixes spelling name ranges for user-defined string literal operators.

Example:

constexpr int operator""_toint(unsigned long long val)
{ return int(val); }

Before this patch the spelling name range on consisted of 'operator'.

After this patch: 'operator""_toint'.

Related to http://reviews.llvm.org/D5041, which fixes the function for
other cursor kinds.

Diff Detail

Repository
rL LLVM

Event Timeline

kfunk updated this revision to Diff 51608.Mar 24 2016, 3:07 PM
kfunk retitled this revision from to Fix for clang_Cursor_getSpellingNameRange().
kfunk updated this object.
kfunk added reviewers: skalinichev, milianw.
milianw edited edge metadata.Mar 24 2016, 4:03 PM

+1 from my side, but someone else has to approve

milianw added a project: Restricted Project.
milianw added a subscriber: cfe-commits.
skalinichev added inline comments.Mar 26 2016, 4:50 AM
tools/libclang/CIndex.cpp
4311 ↗(On Diff #51608)

What about function templates?

E.g.: template <char...> double operator "" _x();

ping, any update on this?

kfunk added a comment.Sep 15 2016, 2:11 AM

@other LLVM devs: Please review so we can finally ship this?

tools/libclang/CIndex.cpp
4311 ↗(On Diff #51608)

Still broken for function template. The fix isn't as easy as adding another check for C.kind == CXCursor=FunctionTemplate, though.

We should fix this in another patch.

milianw accepted this revision.Sep 15 2016, 2:35 AM
milianw edited edge metadata.

agreed, lgtm but someone else must accept this upstream

This revision is now accepted and ready to land.Sep 15 2016, 2:35 AM
bkramer accepted this revision.Sep 15 2016, 3:00 PM
bkramer edited edge metadata.

looks good from my side.

This revision was automatically updated to reflect the committed changes.