| Summary: | content assist not working inside placement new | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Mike Kucera <mikekucera> | ||||||
| Component: | cdt-parser | Assignee: | Markus Schorn <mschorn.eclipse> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | Mike Kucera <mikekucera> | ||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | john_ws_liu | ||||||
| Version: | 6.0.2 | ||||||||
| Target Milestone: | 7.0.1 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Created attachment 176010 [details]
testcase + fix
Created attachment 176020 [details]
improved patch and additional testcases
Fixed in 7.0.1 and 8.0 > 20100806. *** cdt cvs genie on behalf of mschorn *** Bug 313982: Content assist in placement new. [*] BasicCompletionTest.java 1.23 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/prefix/BasicCompletionTest.java?root=Tools_Project&r1=1.22&r2=1.23 [*] GNUCPPSourceParser.java 1.235 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java?root=Tools_Project&r1=1.234&r2=1.235 [*] BasicCompletionTest.java 1.22.2.1 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/prefix/BasicCompletionTest.java?root=Tools_Project&r1=1.22&r2=1.22.2.1 [*] GNUCPPSourceParser.java 1.231.2.2 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java?root=Tools_Project&r1=1.231.2.1&r2=1.231.2.2 (In reply to comment #2) > Created an attachment (id=176020) [details] > improved patch and additional testcases hi, Markus: Should the test code for Bug313982b be // struct B { // int m; // }; // int foo() { // B * b; // new (b->m) and for Bug313982c be: // struct B { // int m; // }; // int foo() { // B * b; // new (b->m) Like no B at the end, I am sure how the offset is calculated in the completion parsing test, just wondering if it should not include the expected proposal code. (In reply to comment #5) > (In reply to comment #2) > > Created an attachment (id=176020) [details] [details] > > improved patch and additional testcases > hi, Markus: > Should the test code for Bug313982b be > // struct B { > // int m; > // }; > // int foo() { > // B * b; > // new (b->m) > and for Bug313982c be: > // struct B { > // int m; > // }; > // int foo() { > // B * b; > // new (b->m) > Like no B at the end, I am sure how the offset is calculated in the completion > parsing test, just wondering if it should not include the expected proposal > code. Sorry copy the same code twice, should the test code for Bug313982c be: // struct B { // int m; // }; // int foo() { // B * b; // new (b->m) ( (In reply to comment #6) > (In reply to comment #5) > > (In reply to comment #2) > > > Created an attachment (id=176020) [details] [details] [details] > > > improved patch and additional testcases > > hi, Markus: > > Should the test code for Bug313982b be > > // struct B { > > // int m; > > // }; > > // int foo() { > > // B * b; > > // new (b->m) > > and for Bug313982c be: > > // struct B { > > // int m; > > // }; > > // int foo() { > > // B * b; > > // new (b->m) > > Like no B at the end, I am sure how the offset is calculated in the completion > > parsing test, just wondering if it should not include the expected proposal > > code. > Sorry copy the same code twice, should the test code for Bug313982c be: > // struct B { > // int m; > // }; > // int foo() { > // B * b; > // new (b->m) ( Err.. I meant I am NOT* sure how the offset is calculated in the completion parsing test, so wondering if the test code should not include the expected proposal code. The testcases simulate content-assist invoked after the last character of the provided source. In testcase b and c I provided the prefix 'B' in the code because otherwise all global types would be proposed, including some builtin types that depend on the parser configuration. |
struct A { int a; }; struct B { int b; }; int foo() { B * b = new B(); A * a = new (b-><ctrl-space>) A(); } No proposals, expecting b to be proposed. This contrived example shows that content assist does not work inside placement new syntax.