Bug 377397 - "Implement ..." template for template methods misses the keyword "typename"
Summary: "Implement ..." template for template methods misses the keyword "typename"
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (Clang-based) (show other bugs)
Version: 5.1.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-08 23:33 UTC by Anton Kreuzkamp
Modified: 2018-03-15 10:44 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Kreuzkamp 2017-03-08 23:33:51 UTC
Steps to reproduce:
1. Create a c++ project and use the clang-plugin.
2. Write a template class 
```
template<typename T> class Foo {
    void bar();
};
```
3. Below (or in the cpp) press CTRL+Space at an appropriate place in order to get an completion proposal "Implement void Foo<T>::bar()"
4. Press Enter.

The code will look like
```
template<T> void Foo<T>::bar()
{
}
```
while it needs to look like
```
template<typename T> void Foo<T>::bar()
{
}
```
Comment 1 Milian Wolff 2018-03-15 10:44:08 UTC
Git commit 782645190f44ca1dd147e45d18fc354ef6282186 by Milian Wolff, on behalf of Shashwat Dixit.
Committed on 15/03/2018 at 10:43.
Pushed by mwolff into branch 'master'.

Fix Template (Class/Function) Signatures in Clang Code Completion

Summary:
  - Create correct template prefix for Class/Function Templates

  - Handle Template Template Parameter

  - Do not drop function parameters for FunctionTemplates
Related: bug 368544

Reviewers: #kdevelop, aspotashev, mwolff

Subscribers: #kdevelop, kdevelop-devel

Tags: #kdevelop

Differential Revision: https://phabricator.kde.org/D10277

M  +30   -5    plugins/clang/codecompletion/completionhelper.cpp
M  +28   -0    plugins/clang/tests/test_codecompletion.cpp
M  +26   -2    plugins/clang/util/clangutils.cpp

https://commits.kde.org/kdevelop/782645190f44ca1dd147e45d18fc354ef6282186