Bug 512515 - Content assist inserts function argument in wrong place when parameter has no name
Summary: Content assist inserts function argument in wrong place when parameter has no...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-editor (show other bugs)
Version: 9.2.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-21 12:39 EST by Yan Pas CLA
Modified: 2020-09-04 15:16 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yan Pas CLA 2017-02-21 12:39:02 EST
Example


#define OLOLO(args)	args

int foo OLOLO((int,int));

int main() {
	int a,b;
	foo/*press Ctrl+Space, CA will suggest you a or b, insert them*/
}

this results in:
foo(a)
b
Comment 1 Nathan Ridge CLA 2017-02-21 19:47:12 EST
This seems to be unrelated to macros. I see the same behaviour with:

int foo(int,int);

int main() {
    int a,b;
    foo/*press Ctrl+Space, CA will suggest you a or b, insert them*/
}

The issue seems to be related to the function parameters being unnamed.
Comment 2 Nathan Ridge CLA 2017-02-21 19:48:26 EST
We also get pretty bad behaviour in the case where the second parameter has a name but the first one does not:

int foo(int,int y);

int main() {
    int a,b;
    foo/*cursor*/
}

Interestingly, we get the case where the first parameter has a name but the second one does not, correct.