Bug 525504 - return type of EvalFunctionCall bound to wrong owner
Summary: return type of EvalFunctionCall bound to wrong owner
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-indexer (show other bugs)
Version: Next   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-03 09:04 EDT by Michael Woski CLA
Modified: 2020-09-04 15:24 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Woski CLA 2017-10-03 09:04:52 EDT
template <char I>
struct A {
    static A<I>*
    get();
};

template <char J>
void
test()
{
    A<J>::get()./*cursor*/
}


in the above example fFieldOwner of the return type (EvalID) is null. Alternatively, if you wrap the above test method inside another class, that class becomes the fieldOwner. As a consequence lookups in the ownerType will simply yield nothing.
Referring to the get method inside class A works though.

I'm not sure how to fix this right now.
Comment 1 Nathan Ridge CLA 2017-10-03 22:40:12 EDT
For static calls, EvalID.fNameOwner is used rather than fFieldOwner.

Notice how EvalID.instantiate() will perform a lookup (via resolveName()) in either the name owner or the field owner, preferring the name owner if there is one.

Similarly, HeuristicResolver.resolveEvalType() should try to lookInside() the name owner, too.