Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 347523

Summary: [qf] Create local variable quick fix creates variable of invalid type
Product: [Tools] CDT Reporter: Sergey Prigogin <eclipse.sprigogin>
Component: cdt-editorAssignee: Project Inbox <cdt-editor-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: normal    
Priority: P3 CC: aegges, cdtdoug, elaskavaia.cdt, kosashi, yevshif
Version: 8.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
fix + test none

Description Sergey Prigogin CLA 2011-05-27 17:05:41 EDT
In the following code, position the cursor on x and select Create local variable from the quick fix menu.

void f(double* p, int q);

void test() {
    int x;
  f(&x, 0);
}

The variable is created with int type instead of double:

void f(double* p, int q);

void test() {
    int x;
  f(&x, 0);
}
Comment 1 Tomasz Wesolowski CLA 2011-06-19 18:27:21 EDT
I've got this solved. I can't isolate a patch for this yet as it depends on some stuff done in bug 342160.
Comment 2 Tomasz Wesolowski CLA 2011-06-19 18:32:19 EDT
The patch also handles cases such as f(&&x,0) and f(*x, 0).
Comment 3 Tomasz Wesolowski CLA 2011-06-19 18:33:24 EDT
> f(&&x, 0)

should be: f(**x, 0)
Comment 4 Tomasz Wesolowski CLA 2011-07-02 07:08:39 EDT
Created attachment 198998 [details]
fix + test

depends on 342160

Local branching in Git seems to be helpful.. I hope I made the patch right. :)
Comment 5 Tomasz Wesolowski CLA 2011-07-27 08:28:02 EDT
Patch was merged into fix for bug 342160