Bug 368544 - Implementation generator drops parameters of method template
Summary: Implementation generator drops parameters of method template
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (Clang-based) (show other bugs)
Version: git master
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-10 11:08 UTC by Alexander Potashev
Modified: 2018-03-15 10:44 UTC (History)
0 users

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


Attachments
screenshot (45.48 KB, image/png)
2016-09-10 11:08 UTC, Alexander Potashev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Potashev 2016-09-10 11:08:00 UTC
Consider the following example:

class Klass {
public:
  template <typename T>
  void func(int a, T x, int b) const;
};

When I press Ctrl+Space, I'm offered to implement "func()" without parameters, see screenshot.

When I press Enter, the following code is inserted:

void Klass::func() const
{
}


Reproducible: Always
Comment 1 Alexander Potashev 2016-09-10 11:08:25 UTC
Created attachment 101010 [details]
screenshot
Comment 2 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 377397

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