Bug 233816 - "inline" problems with implementing function in header
Summary: "inline" problems with implementing function in header
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (show other bugs)
Version: 3.9.99
Platform: Compiled Sources Unspecified
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-09 12:26 UTC by Freddie Witherden
Modified: 2011-06-17 04:08 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Freddie Witherden 2010-04-09 12:26:54 UTC
Version:           3.9.99 (using Devel)
Installed from:    Compiled sources

Consider (in a header file):
class Foo { public: Foo(); };

Attempting to implement the method outside of the class (but still in the header file) using the code completion "Implement ..." has two problems. Firstly 'inline' is not prefixed and secondly that if one writes inline first and then uses the completion KDevelop overwrites the inline.

KDevelop should detect when a class method is being implemented in a header file and prefix inline accordingly.

In addition, if one defines a type in the class:
class Foo { public: typedef int T; Foo(T something); };

One needs to write: Foo::Foo(Foo::T something) (prefixing the types by Foo::) when implementing the method. KDevelop currently does not do this.
Comment 1 Olivier.jg 2010-12-17 06:14:24 UTC
The second issue is fixed.
The first issue still sortof exists in that kdevelop won't prefix with inline for you automatically. It doesn't overwrite anymore though.
Still, isn't adding inline to a header function more of a convention than a rule? Should KDevelop do this?
Comment 2 Milian Wolff 2010-12-17 13:13:27 UTC
the inline case is still present, this is both broken:

class Foo { public: Foo(); };

inline | // ctrl + space won't offer implementing the ctor
inline Foo:: // implementing ctor now will remove inline
Comment 3 Olivier.jg 2011-06-17 04:08:28 UTC
Git commit fe266924e45ea4a8cdab6aa5c3e865fa722d0ea8 by Olivier JG.
Committed on 17/06/2011 at 04:01.
Pushed by olivierjg into branch 'master'.

Don't overwrite "inline" when implementing function.
BUG: 233816

M  +3    -2    languages/cpp/codecompletion/implementationhelperitem.cpp     

http://commits.kde.org/kdevelop/fe266924e45ea4a8cdab6aa5c3e865fa722d0ea8