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

Bug 351547

Summary: Delete expression lacks implicit name with binding to operator delete
Product: [Tools] CDT Reporter: Thomas Corbat <thomas.corbat>
Component: cdt-parserAssignee: Markus Schorn <mschorn.eclipse>
Status: RESOLVED FIXED QA Contact: Doug Schaefer <cdtdoug>
Severity: minor    
Priority: P3 CC: cdtdoug
Version: 8.0   
Target Milestone: 8.0.1   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Thomas Corbat CLA 2011-07-08 07:23:28 EDT
Build Identifier: I20110613-1736

After creating an AST for code that contains a delete statement, the AST node for that delete expression (CPPASTDeleteExpression) contains an implicit name for the destructor of the operand's type. This implicit name has a binding to the corresponding destructor. Now we are lacking the reference to the operator delete of the operand's type. In previous versions (CDT 7.0) there was an additional implicit name for this operator with a corresponding binding.

Example code:
struct A {
	void operator delete(void * a){
	}
};

int main() {
	A *a = new A;
	delete a;
}

Reproducible: Always

Steps to Reproduce:
1. Create a C++ Project and a source file.
2. Copy/Paste the example code from the details.
3. Create an AST for that file.
Comment 1 Markus Schorn CLA 2011-07-20 06:14:30 EDT
Added testcase, fixed in 8.0.1 > 20110720.
Comment 2 CDT Genie CLA 2011-07-20 06:19:39 EDT
*** cdt git genie on behalf of 351547 ***

    Bug 351547: Resolution of delete expressions.

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=34fdfb11964bdd89930641b0bff118f089fdb126
Comment 3 CDT Genie CLA 2011-07-20 07:19:35 EDT
*** cdt git genie on behalf of 351547 ***

    Bug 351547: Resolution of delete expressions.

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=13bb1c1037aad223cd883ebe7470b80c3881f66a