| Summary: | No support for references through dependent names. | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | John Liu <john_ws_liu> |
| Component: | cdt-parser | Assignee: | Project Inbox <cdt-parser-inbox> |
| Status: | NEW --- | QA Contact: | Jonah Graham <jonah> |
| Severity: | normal | ||
| Priority: | P3 | CC: | haoqing, jens.elmenthaler, konradsa, mail, subscribe, yevshif, zeratul976 |
| Version: | 7.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 536160 | ||
At this point CDT has no support for references that are made through dependent names. (The parser does not actually instantiate the function-body to resolve names therein.) *** Bug 436958 has been marked as a duplicate of this bug. *** *** Bug 508957 has been marked as a duplicate of this bug. *** Note that bug 490475 has added infrastructure for instantiating function bodies. (The motivation there was C++14 constexpr evaluation for function templates, but the infrastructure generalizes to other uses.) It would be possible to use this infrastructure to record references through dependent names during indexing. However, this would require instantiating all function templates during indexing (not just constexpr ones), which may have a significant performance impact. How about making it optional? I think it would be extremely useful if the indexer could handle templates correctly/completely, even if it would take a while to build that index. (In reply to Michael Teske from comment #5) > How about making it optional? I think it would be extremely useful if the > indexer could handle templates correctly/completely, even if it would take a > while to build that index. Yes, I think this is what we'll need to do. Introduce an option in the indexer preferences to instantiate function bodies, and let users decide if they like the performance / accuracy tradeoff. *** Bug 332430 has been marked as a duplicate of this bug. *** *** Bug 509986 has been marked as a duplicate of this bug. *** If/when we fix this, we should go through the duplicate bugs and make sure the testcases in each of them start working. *** Bug 578520 has been marked as a duplicate of this bug. *** |
Build Identifier: Call hierarchy doesn't work properly for a template function. In this example code: //TEMPLATE FUNCTIONS template <class type> type retName(type Name){ return Name; } template <class type> type getName(type Name1){ type A = retName(Name1); return A; } int main() { getName <int> (6); getNum(7); } Right click on retName -> call hierarchy, then the result caller list is empty, but getName should be there. Right click on getName -> call hierarchy, the the result caller list has main function, which is correct, but callee list is empty, retName should be there. I searched bugzilla bugs for call hierarchy problem related to template to avoid opening a duplicate bug, and found https://bugs.eclipse.org/bugs/show_bug.cgi?id=240589 may be related to it, but not the exactly same problem. Reproducible: Always