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

Bug 360609

Summary: Methods in C++ temporary objects are not recognized
Product: [Tools] CDT Reporter: vagran <vagran.ast>
Component: cdt-parserAssignee: Project Inbox <cdt-parser-inbox>
Status: RESOLVED WORKSFORME QA Contact: Markus Schorn <mschorn.eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug, vagran.ast
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description vagran CLA 2011-10-12 01:15:23 EDT
Build Identifier: 20110916-0149

In the following code:
MyFunction(MyClass(constrArg).MyMethod());
method MyMethod() of the temporary object of class MyClass is not recognized (error "Method 'MyMethod' could not be resolved") as well as the result of the expression "MyClass(constrArg).MyMethod()" is not correctly recognized.

Reproducible: Always

Steps to Reproduce:
1. Create code "MyFunction(MyClass(constrArg).MyMethod());" in C++ CDT project. C++ code analysis error will appear as well as MyMethod declaration will not be found by IDE (if you point on it and press F3).
Comment 1 vagran CLA 2011-10-12 01:17:17 EDT
CDT version 8.0.0.201109151620.
Comment 2 Markus Schorn CLA 2011-10-31 09:46:04 EDT
I have tested with:

struct A {
	A(int);
	int m();
};

void f(int);
void test() {
	f(A(1).m());
}