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

Bug 320575

Summary: Quick fix for add field or variable results in "void a;"
Product: [Tools] CDT Reporter: Elena Laskavaia <elaskavaia.cdt>
Component: cdt-codanAssignee: Elena Laskavaia <elaskavaia.cdt>
Status: RESOLVED FIXED QA Contact: Elena Laskavaia <elaskavaia.cdt>
Severity: normal    
Priority: P3 CC: cdtdoug
Version: 7.0   
Target Milestone: 8.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
fixed inference for function call cdtdoug: iplog+

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