Bug 272834 - Cursor placement is wrong for functions with "(void)" arguments
Summary: Cursor placement is wrong for functions with "(void)" arguments
Status: RESOLVED WORKSFORME
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (Clang-based) (show other bugs)
Version: 5.2.1
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-09 08:10 UTC by Rolf Eike Beer
Modified: 2018-09-23 16:15 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
The bug has already been resolved. (770.60 KB, image/png)
2016-04-23 05:22 UTC, Sumeet Tulsani
Details
Bug has been resolved (576.08 KB, image/png)
2016-04-23 05:24 UTC, Sumeet Tulsani
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rolf Eike Beer 2011-05-09 08:10:09 UTC
Version:           4.2.1 (using KDE 4.6.2) 
OS:                Linux

Version is KDevelop 4.2.2 on KDE 4.6.3, but Bugzilla didn't have this versions available.

static int foo() { return 32; }
static int bar(void) { return 42; }

int main(void)
{
	int baz = 0;
	baz += foo();
	baz += bar();
	return baz;
}

Try duplicating the += lines and use code completion. You will see that for foo() the cursor is placed behind the closing brace, for bar() it is placed between the braces.


Reproducible: Always




OS: Linux (i686) release 2.6.37-12-desktop
Compiler: gcc
Comment 1 Rolf Eike Beer 2013-10-09 14:50:15 UTC
kdevplatform/language/codecompletion/codecompletionhelper.cpp::insertFunctionParenText() -> bool haveArguments should be adapted according to Milian
Comment 2 Sumeet Tulsani 2016-04-23 05:22:38 UTC
Created attachment 98529 [details]
The bug has already been resolved.

This screenshot shows the use of auto completion.
Comment 3 Sumeet Tulsani 2016-04-23 05:24:36 UTC
Created attachment 98530 [details]
Bug has been resolved

This screenshot shows that the cursor is being placed at correct position.
Comment 4 Kevin Funk 2016-04-23 18:18:54 UTC
@Rolf: Can you check if this issue is fixed in 5.0?
Comment 5 Francis Herne 2018-03-25 23:57:40 UTC
This bug is reversed (!) in 5.2-git with the Clang backend.

The cursor is now placed after the closing brace of `bar()`, but in the middle for `foo()`; it should be at the end in both cases.
Comment 6 Amish Naidu 2018-09-23 16:15:08 UTC
Works as intended with 5.3-git.