Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320575 - Quick fix for add field or variable results in "void a;"
Summary: Quick fix for add field or variable results in "void a;"
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-codan (show other bugs)
Version: 7.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 8.0   Edit
Assignee: Elena Laskavaia CLA
QA Contact: Elena Laskavaia CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-21 20:13 EDT by Elena Laskavaia CLA
Modified: 2011-05-12 16:53 EDT (History)
1 user (show)

See Also:


Attachments
fixed inference for function call (5.17 KB, patch)
2010-07-22 02:36 EDT, Tomasz Wesolowski CLA
cdtdoug: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Elena Laskavaia CLA 2010-07-21 20:13:42 EDT
Test 1:

class TestClass {
public:
	void foo(int a, int b);
};

TestClass::TestClass() {
    foo(a, b); // create fields here
}

void TestClass::foo(int a, int b)
{
}

Test 2:


void foo(){
    if (x){ // create local var here
      a++; // or here
    }
    return;
}

Test 3:

void bar() {
	int a[10];
	a[i]=1; // here
}
Comment 1 CDT Genie CLA 2010-07-21 21:23:03 EDT
*** cdt cvs genie on behalf of elaskavaia ***
Bug 320575 - fallback for add variable should use int not void

[*] CxxAstUtils.java 1.6 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/CxxAstUtils.java?root=Tools_Project&r1=1.5&r2=1.6
Comment 2 Tomasz Wesolowski CLA 2010-07-22 02:36:55 EDT
Created attachment 174945 [details]
fixed inference for function call

solves the problem with Test 1 and "create field"
Comment 4 Elena Laskavaia CLA 2010-07-28 21:59:03 EDT
fixed thanks for the patch