Bug 325476

Summary: no autocomplete when doing template specialization
Product: [Applications] kdevelop Reporter: Marcel Hellwig <keks>
Component: Language Support: CPP (old)Assignee: kdevelop-bugs-null
Status: RESOLVED NOT A BUG    
Severity: normal CC: cponnapalli
Priority: NOR    
Version First Reported In: git master   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Autosuggestion of the method for the instance of a templatized class

Description Marcel Hellwig 2013-09-30 22:20:57 UTC
There is not auto complete when using template specialization. Here is a minimal code example

  template <class Arg>
  class Test;
  
  template <class Arg>
  class Test<void(Arg)>
  {
  public:
      foo();
  };
  
  void bar()
  {
      Test t;
      t.
  }

After t. and Ctrl+Space there is no autocomplete, but it should. I know this is really hard for kdevelop to find out, but please make this working.

Reproducible: Always

Steps to Reproduce:
1. Copy the code
2. Paste the code
3. Press Ctrl+Space after t.
Actual Results:  
auto complete word

Expected Results:  
auto complete function
Comment 1 chaitanya srinivas ponnapalli 2016-04-22 06:51:02 UTC
Created attachment 98502 [details]
Autosuggestion of the method for the instance of a templatized class
Comment 2 chaitanya srinivas ponnapalli 2016-04-22 06:57:40 UTC
Hi Marcel,

Reproduced the steps. The autosuggestion of the method for the instance of template class does show up. Made slight change in the way the method was declared in the template class, by declaring the return type for the method. This is because as you know, a type specifier is required for all declarations in c++.
Comment 3 Kevin Funk 2016-04-22 07:17:10 UTC
Marking this bug as invalid. The initial code example has invalid code.
a) no return type for `foo`
b) use of class 'Test' requires template arguments.

Fixing (a) + (b) fixes the problem and KDevelop 5.0 successfully provides completion hints.

Code:
```
      Test<void(int)> t;
      t.
```