Type: LanguageService
Describe the bug
intelliSense autocomplete fails to deduce type of templated class declared in templated class/function.
To Reproduce
namespace ID {
template <typename T>
struct addingClass {
public:
addingClass(T a, T b) : result(a + b) {}
const T result;
};
template <typename T>
class TemplatedClass {
public:
static T add(T a, T b) {
auto addition = addingClass<T>(a, b);
auto result = addition.result; // intelliSense provides not provide auto-complete for addingClass::result member
return result;
}
};
}
int main() {
return ID::TemplatedClass<int>::add(-1, 1);
}
Hovering over the addition variable shows auto addition, and line 14 fails to auto-complete the result class member.
Expected behavior
I would expect auto-complete to deduce the class members of the addingClass in the above example.
Screenshots


Additional context
c_cpp_properties.json:
```
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"macFrameworkPath": [],
"compilerPath": "/usr/local/bin/gcc",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-x64",
"configurationProvider": "vector-of-bool.cmake-tools"
}
],
"version": 4
}
Hi @kbthomp1 . I'm able to repro (a minimal version of) your issue in Visual Studio as well. (The C/C++ Extension shares code for IntelliSense with VS). I've opened a bug against VS here: https://developercommunity.visualstudio.com/content/problem/936260/intellisense-instance-of-template-stored-in-auto-d.html
Most helpful comment
Hi @kbthomp1 . I'm able to repro (a minimal version of) your issue in Visual Studio as well. (The C/C++ Extension shares code for IntelliSense with VS). I've opened a bug against VS here: https://developercommunity.visualstudio.com/content/problem/936260/intellisense-instance-of-template-stored-in-auto-d.html