Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347523 - [qf] Create local variable quick fix creates variable of invalid type
Summary: [qf] Create local variable quick fix creates variable of invalid type
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-editor (show other bugs)
Version: 8.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-27 17:05 EDT by Sergey Prigogin CLA
Modified: 2020-09-04 15:21 EDT (History)
5 users (show)

See Also:


Attachments
fix + test (9.97 KB, patch)
2011-07-02 07:08 EDT, Tomasz Wesolowski CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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